1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-27 16:10:57 -05:00
denoland-deno/cli/tests/ts_decorators_bundle.ts
Bartek Iwańczuk 4f57ca0daf
fix: panic in bundler (#8168)
This commit fixes panic in bundler which was caused
by not setting thread-local slots.
2020-10-30 12:19:49 +01:00

22 lines
475 B
TypeScript

/* eslint-disable */
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();