TypeScript/tests/baselines/reference/decoratedBlockScopedClass2.types
Oleksandr T a15030ff6f
fix(35050): Decorator emit incorrect within try block (#41951)
* fix(35050): fix decorated block-scoped class emit

* Only use internal name when targeting ES5/3

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-07-08 10:48:02 -07:00

36 lines
812 B
Plaintext

=== tests/cases/conformance/decorators/class/a.ts ===
function decorator() {
>decorator : () => (target: new (...args: any[]) => any) => void
return (target: new (...args: any[]) => any) => {}
>(target: new (...args: any[]) => any) => {} : (target: new (...args: any[]) => any) => void
>target : new (...args: any[]) => any
>args : any[]
}
try {
@decorator()
>decorator() : (target: new (...args: any[]) => any) => void
>decorator : () => (target: new (...args: any[]) => any) => void
class Foo {
>Foo : Foo
public static func(): Foo {
>func : () => Foo
return new Foo();
>new Foo() : Foo
>Foo : typeof Foo
}
}
Foo.func();
>Foo.func() : Foo
>Foo.func : () => Foo
>Foo : typeof Foo
>func : () => Foo
}
catch (e) {}
>e : any