summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/ts_decorators_bundle.ts
blob: 72120b2ec3af892e8609b8c868a6302618eae99f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// deno-lint-ignore-file

import { B } from "./subdir/more_decorators.ts";

function Decorator() {
  return function (
    target: Record<string, any>,
    propertyKey: string,
    descriptor: TypedPropertyDescriptor<any>,
  ) {
    const originalFn: Function = descriptor.value as Function;
    descriptor.value = async function (...args: any[]) {
      return await originalFn.apply(this, args);
    };
    return descriptor;
  };
}

class SomeClass {
  @Decorator()
  async test() {}
}

new SomeClass().test();
new B().method();