1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 08:09:08 -05:00
denoland-deno/cli/tests/ts_decorators_bundle.ts
2020-11-02 22:33:43 +11:00

25 lines
543 B
TypeScript

/* eslint-disable */
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(): Promise<void> {}
}
new SomeClass().test();
new B().method();