You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
or the source code:
`// @experimentalDecorators
function LogMethod(
target: any,
propertyKey: string | symbol,
descriptor: PropertyDescriptor
) {
console.log(target);
console.log(propertyKey);
console.log(descriptor);
}
class Demo { @logmethod
public static foo(bar: number) {
// do nothing
}
@logmethod
public foo2(bar: number) {
// do nothing
}
}
const demo = new Demo();
Demo.foo(10);
demo.foo2(12);`
The output of js with something like __decorate(([...], Demo.prototype, "foo2", null)
but the karma-typescript output code like __decorate([LogMethod], Demo.prototype, 'foo2')
the missing null at end will make the code in __decorate as following: r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc
make the desc keep the undefined value because undefined === null is false.
Please see bellow pictures about the output.
The is the output in TypeScript Playground
And the output of karma
The text was updated successfully, but these errors were encountered:
Please try with the code in TypeScript Playground
or the source code:
`// @experimentalDecorators
function LogMethod(
target: any,
propertyKey: string | symbol,
descriptor: PropertyDescriptor
) {
console.log(target);
console.log(propertyKey);
console.log(descriptor);
}
class Demo {
@logmethod
public static foo(bar: number) {
// do nothing
}
@logmethod
public foo2(bar: number) {
// do nothing
}
}
const demo = new Demo();
Demo.foo(10);
demo.foo2(12);`
The output of js with something like
__decorate(([...], Demo.prototype, "foo2", null)
but the karma-typescript output code like
__decorate([LogMethod], Demo.prototype, 'foo2')
the missing null at end will make the code in __decorate as following:
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc
make the desc keep the undefined value because undefined === null is false.
Please see bellow pictures about the output.

The is the output in TypeScript Playground
And the output of karma

The text was updated successfully, but these errors were encountered: