file_path
stringlengths
3
280
file_language
stringclasses
66 values
content
stringlengths
1
1.04M
repo_name
stringlengths
5
92
repo_stars
int64
0
154k
repo_description
stringlengths
0
402
repo_primary_language
stringclasses
108 values
developer_username
stringlengths
1
25
developer_name
stringlengths
0
30
developer_company
stringlengths
0
82
crates/swc_ecma_parser/tests/tsc/es6modulekindWithES5Target4.ts
TypeScript
// @target: es5 // @module: es2015 class E { } export default E;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/es6modulekindWithES5Target5.ts
TypeScript
// @target: es5 // @module: es2015 // @preserveConstEnums: true export enum E1 { value1 } export const enum E2 { value1 }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/es6modulekindWithES5Target6.ts
TypeScript
// @target: es5 // @module: es2015 export function f1(d = 0) { } export function f2(...arg) { } export default function f3(d = 0) { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/es6modulekindWithES5Target7.ts
TypeScript
// @target: es5 // @module: es2015 export namespace N { var x = 0; } export namespace N2 { export interface I { } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/es6modulekindWithES5Target8.ts
TypeScript
// @target: es5 // @module: es2015 export const c = 0; export let l = 1;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/es6modulekindWithES5Target9.ts
TypeScript
// @target: es5 // @module: es2015 import d from "mod"; import {a} from "mod"; import * as M from "mod"; export {a}; export {M}; export {d}; export * from "mod"; export {b} from "mod" export default d;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-accessors-nonStatic.ts
TypeScript
// @target: esnext, es2022, es2015, es5 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; const method3 = "method3"; class C { @dec(11) get method1() { return 0; } @dec(12) set method1(value) {} @dec(21) get ["method2"]() { return 0; } @dec(22) set ["method2"](value) {} @dec(31) get [method3]() { return 0; } @dec(32) set [method3](value) {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-accessors-nonStaticPrivate.ts
TypeScript
// @target: esnext, es2022, es2015 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; class C { @dec(1) get #method1() { return 0; } @dec(2) set #method1(value) {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-accessors-static.ts
TypeScript
// @target: esnext, es2022, es2015, es5 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; const method3 = "method3"; class C { @dec(11) static get method1() { return 0; } @dec(12) static set method1(value) {} @dec(21) static get ["method2"]() { return 0; } @dec(22) static set ["method2"](value) {} @dec(31) static get [method3]() { return 0; } @dec(32) static set [method3](value) {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-accessors-staticPrivate.ts
TypeScript
// @target: esnext, es2022, es2015 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; class C { @dec(1) static get #method1() { return 0; } @dec(2) static set #method1(value) {} } @dec class D { static get #method1() { return 0; } static set #method1(value) {} static { this.#method1; this.#method1 = 1; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-classSuper.1.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; declare class Base { static method(...args: any[]): void; } const method = "method"; @dec class C extends Base { static { super.method(); super["method"](); super[method](); super.method``; super["method"]``; super[method]``; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-classSuper.2.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; // class expression in extends should not get an assigned name @dec class C1 extends class { } { static { super.name; } } // function expression in extends should not get an assigned name @dec class C2 extends (function() {} as any) { static { super.name; } } // arrow function in extends should not get an assigned name @dec class C3 extends ((() => {}) as any) { static { super.name; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-classSuper.3.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; declare class Base { static x: number; } const x = "x"; @dec class C extends Base { static { super.x; super.x = 1; super.x += 1; super.x++; super.x--; ++super.x; --super.x; ({ x: super.x } = { x: 1 }); [super.x] = [1]; super["x"]; super["x"] = 1; super["x"] += 1; super["x"]++; super["x"]--; ++super["x"]; --super["x"]; ({ x: super["x"] } = { x: 1 }); [super["x"]] = [1]; super[x]; super[x] = 1; super[x] += 1; super[x]++; super[x]--; ++super[x]; --super[x]; ({ x: super[x] } = { x: 1 }); [super[x]] = [1]; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-classSuper.4.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; declare class Base { static method(...args: any[]): number; } const method = "method"; @dec class C extends Base { static a = super.method(); static b = super["method"](); static c = super[method](); static d = super.method``; static e = super["method"]``; static f = super[method]``; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-classSuper.5.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; declare class Base { static x: number; } const x = "x"; @dec class C1 extends Base { static a = super.x; static b = super.x = 1; static c = super.x += 1; static d = super.x++; static e = super.x--; static f = ++super.x; static g = --super.x; static h = ({ x: super.x } = { x: 1 }); static i = [super.x] = [1]; } @dec class C2 extends Base { static a = super["x"]; static b = super["x"] = 1; static c = super["x"] += 1; static d = super["x"]++; static e = super["x"]--; static f = ++super["x"]; static g = --super["x"]; static h = ({ x: super["x"] } = { x: 1 }); static i = [super["x"]] = [1]; } @dec class C3 extends Base { static a = super[x]; static b = super[x] = 1; static c = super[x] += 1; static d = super[x]++; static e = super[x]--; static f = ++super[x]; static g = --super[x]; static h = ({ x: super[x] } = { x: 1 }); static i = [super[x]] = [1]; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-classSuper.6.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; declare class Base { static method(...args: any[]): number; method(...args: any[]): number; } // none of the following should result in caching `super` @dec class C extends Base { static m() { super.method(); } static get x() { return super.method(); } static set x(v: number) { super.method(); } constructor() { super(); super.method(); } a = super.method(); m() { super.method(); } get x() { return super.method(); } set x(v: number) { super.method(); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-classSuper.7.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true class A {} class B extends A { public constructor() { 'inject'; super(); const a = 1; const b = 1; } @foo public m(): void {} } function foo(method: any, _context: any): any { return function (this: any) { method.call(this); }; } new B(); // https://github.com/microsoft/TypeScript/issues/53448 class C { public constructor() { this.val; } @foo public get val(): number { return 3; } } class D extends A { public constructor() { super(); this.val; } @foo public get val(): number { return 3; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-classThisReference.es5.ts
TypeScript
// @target: es5 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; @dec class C { static { this; } static x: any = this; static m() { this; } static get g() { return this; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-classThisReference.ts
TypeScript
// @target: esnext, es2022, es2015 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; @dec class C { static { this; } static x: any = this; static accessor a: any = this; static m() { this; } static get g() { return this; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-commentPreservation.ts
TypeScript
// @target: esnext, es2022, es2015 // @module: esnext, commonjs // @noEmitHelpers: true // @noTypesAndSymbols: true // @filename: file1.ts declare var dec: any; /*1*/ @dec /*2*/ @dec /*3*/ class C { /*4*/ @dec /*5*/ @dec /*6*/ method() {} /*7*/ @dec /*8*/ @dec /*9*/ get x() { return 1; } /*10*/ @dec /*11*/ @dec /*12*/ set x(value: number) { } /*13*/ @dec /*14*/ @dec /*15*/ y = 1; /*16*/ @dec /*17*/ @dec /*18*/ accessor z = 1; /*19*/ @dec /*20*/ @dec /*21*/ static #method() {} /*22*/ @dec /*23*/ @dec /*24*/ static get #x() { return 1; } /*25*/ @dec /*26*/ @dec /*27*/ static set #x(value: number) { } /*28*/ @dec /*29*/ @dec /*30*/ static #y = 1; /*31*/ @dec /*32*/ @dec /*33*/ static accessor #z = 1; } // @filename: file2.ts /*34*/ @dec /*35*/ @dec /*36*/ export class D { } /*37*/ @dec /*38*/ @dec /*39*/ export default class E { } // @filename: file3.ts /*40*/ export /*41*/ @dec /*42*/ @dec /*43*/ class F { } /*44*/ export default /*45*/ @dec /*46*/ @dec /*47*/ class G { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-commonjs-classNamespaceMerge.ts
TypeScript
// @target: es2022 // @module: commonjs declare var deco: any; @deco export class Example { static foo() {} } export namespace Example { export const x = 1; } Example.foo();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-commonjs.ts
TypeScript
// @target: es2022 // @module: commonjs declare var deco: any; @deco export class Example { static foo() {} } Example.foo();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-fields-nonStatic.ts
TypeScript
// @target: esnext, es2022, es2015, es5 // @useDefineForClassFields: * // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; const field3 = "field3"; class C { @dec(1) field1 = 1; @dec(2) ["field2"] = 2; @dec(3) [field3] = 3; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-fields-nonStaticAccessor.ts
TypeScript
// @target: esnext, es2022, es2015 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; const field3 = "field3"; class C { @dec(1) accessor field1 = 1; @dec(2) accessor ["field2"] = 2; @dec(3) accessor [field3] = 3; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-fields-nonStaticPrivate.ts
TypeScript
// @target: esnext, es2022, es2015 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; class C { @dec #field1 = 0; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-fields-nonStaticPrivateAccessor.ts
TypeScript
// @target: esnext, es2022, es2015 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; class C { @dec accessor #field1 = 0; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-fields-static.ts
TypeScript
// @target: esnext, es2022, es2015, es5 // @useDefineForClassFields: * // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; const field3 = "field3"; class C { @dec(1) static field1 = 1; @dec(2) static ["field2"] = 2; @dec(3) static [field3] = 3; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-fields-staticAccessor.ts
TypeScript
// @target: esnext, es2022, es2015 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; const field3 = "field3"; class C { @dec(1) static accessor field1 = 1; @dec(2) static accessor ["field2"] = 2; @dec(3) static accessor [field3] = 3; } @dec class D { static accessor field1 = 1; static { this.field1; this.field1 = 1; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-fields-staticPrivate.ts
TypeScript
// @target: esnext, es2022, es2015 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; class C { @dec static #field1 = 0; } @dec class D { static #field1 = 0; static { this.#field1; this.#field1 = 1; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-fields-staticPrivateAccessor.ts
TypeScript
// @target: esnext, es2022, es2015 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; class C { @dec static accessor #field1 = 0; } @dec class D { static accessor #field1 = 0; static { this.#field1; this.#field1 = 1; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-methods-nonStatic.ts
TypeScript
// @target: esnext, es2022, es2015, es5 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; const method3 = "method3"; class C { @dec(1) method1() {} @dec(2) ["method2"]() {} @dec(3) [method3]() {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-methods-nonStaticPrivate.ts
TypeScript
// @target: esnext, es2022, es2015 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; class C { @dec #method1() {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-methods-static.ts
TypeScript
// @target: esnext, es2022, es2015, es5 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; const method3 = "method3"; class C { @dec(1) static method1() {} @dec(2) static ["method2"]() {} @dec(3) static [method3]() {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-methods-staticPrivate.ts
TypeScript
// @target: esnext, es2022, es2015 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; class C { @dec static #method1() {} } @dec class D { static #method1() {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-classDecorator.1.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers @dec class C {} // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-classDecorator.2.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers, __setFunctionName export default @dec class {} // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-classDecorator.3.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers, __setFunctionName @dec class C { static #foo() {} } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-nonStaticPrivateAutoAccessor.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers, __setFunctionName class C { @dec accessor #x: any; } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-nonStaticPrivateField.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers class C { @dec #x: any; } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-nonStaticPrivateGetter.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers, __setFunctionName class C { @dec get #foo() { return 1; } } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-nonStaticPrivateMethod.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers, __setFunctionName class C { @dec #foo() {} } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-nonStaticPrivateSetter.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers, __setFunctionName class C { @dec set #foo(value: number) { } } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-staticComputedGetter.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; declare var x: any; // needs: __esDecorate, __runInitializers, __propKey class C { @dec static get [x]() { return 1; } } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-staticComputedMethod.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; declare var x: any; // needs: __esDecorate, __runInitializers, __propKey class C { @dec static [x]() {} } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-staticComputedSetter.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; declare var x: any; // needs: __esDecorate, __runInitializers, __propKey class C { @dec static set [x](value: number) { } } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-staticPrivateAutoAccessor.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers, __setFunctionName class C { @dec static accessor #x: any; } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-staticPrivateField.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers class C { @dec static #x: any; } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-staticPrivateGetter.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers, __setFunctionName class C { @dec static get #foo() { return 1; } } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-staticPrivateMethod.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers, __setFunctionName class C { @dec static #foo() {} } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-missingEmitHelpers-staticPrivateSetter.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {} declare var dec: any; // needs: __esDecorate, __runInitializers, __setFunctionName class C { @dec static set #foo(value: number) { } } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-multipleDecorators.ts
TypeScript
// @target: esnext, es2022, es2015, es5 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec1: any, dec2: any; @dec1 @dec2 class C { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-outerThisReference.ts
TypeScript
// @target: esnext, es2022, es2021, es2015 // @noEmitHelpers: true declare let dec: any; declare let f: any; // `this` should point to the outer `this` in both cases. @dec(this) class A { @dec(this) b = 2; } // `this` should point to the outer `this`, and maintain the correct evaluation order with respect to computed // property names. @dec(this) class B { // @ts-ignore [f(this)] = 1; @dec(this) b = 2; // @ts-ignore [f(this)] = 3; } // The `this` transformation should ensure that decorators inside the class body have privileged access to // private names. @dec(this) class C { #a = 1; @dec(this, (x: C) => x.#a) b = 2; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-parameterProperties.ts
TypeScript
// @target: esnext, es2022, es2015, es5 // @useDefineForClassFields: * // @noEmitHelpers: true // @noTypesAndSymbols: true declare var bound: any; class C { constructor(private message: string) {} @bound speak() { } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-setFunctionName.ts
TypeScript
// @target: esnext, es2022, es2015, es5 // @noEmitHelpers: true // @noTypesAndSymbols: true // @filename: a.ts declare let dec: any; @dec class C {} export {} // @filename: b.ts declare let dec: any; @dec export class C {} // @filename: c.ts declare let dec: any; @dec export default class C {} // @filename: c.ts declare let dec: any; @dec export default class {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-simpleTransformation.ts
TypeScript
// @target: esnext, es2022, es2015, es5 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; @dec class C { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classDeclaration-sourceMap.ts
TypeScript
// @target: esnext, es2022, es2015 // @module: esnext // @sourceMap: true // @declaration: true // @declarationMap: true declare var dec: any; @dec @dec class C { @dec @dec method() {} @dec @dec get x() { return 1; } @dec @dec set x(value: number) { } @dec @dec y = 1; @dec @dec accessor z = 1; @dec @dec static #method() {} @dec @dec static get #x() { return 1; } @dec @dec static set #x(value: number) { } @dec @dec static #y = 1; @dec @dec static accessor #z = 1; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-classSuper.1.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; declare class Base { static method(...args: any[]): void; } const method = "method"; (@dec class C extends Base { static { super.method(); super["method"](); super[method](); super.method``; super["method"]``; super[method]``; } });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-classSuper.2.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; // class expression in extends should not get an assigned name (@dec class C1 extends class { } { static { super.name; } }); // function expression in extends should not get an assigned name (@dec class C2 extends (function() {} as any) { static { super.name; } }); // arrow function in extends should not get an assigned name (@dec class C3 extends ((() => {}) as any) { static { super.name; } });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-classSuper.3.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; declare class Base { static x: number; } const x = "x"; (@dec class C extends Base { static { super.x; super.x = 1; super.x += 1; super.x++; super.x--; ++super.x; --super.x; ({ x: super.x } = { x: 1 }); [super.x] = [1]; super["x"]; super["x"] = 1; super["x"] += 1; super["x"]++; super["x"]--; ++super["x"]; --super["x"]; ({ x: super["x"] } = { x: 1 }); [super["x"]] = [1]; super[x]; super[x] = 1; super[x] += 1; super[x]++; super[x]--; ++super[x]; --super[x]; ({ x: super[x] } = { x: 1 }); [super[x]] = [1]; } });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-classSuper.4.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; declare class Base { static method(...args: any[]): number; } const method = "method"; (@dec class C extends Base { static a = super.method(); static b = super["method"](); static c = super[method](); static d = super.method``; static e = super["method"]``; static f = super[method]``; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-classSuper.5.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; declare class Base { static x: number; } const x = "x"; (@dec class C1 extends Base { static a = super.x; static b = super.x = 1; static c = super.x += 1; static d = super.x++; static e = super.x--; static f = ++super.x; static g = --super.x; static h = ({ x: super.x } = { x: 1 }); static i = [super.x] = [1]; }); (@dec class C2 extends Base { static a = super["x"]; static b = super["x"] = 1; static c = super["x"] += 1; static d = super["x"]++; static e = super["x"]--; static f = ++super["x"]; static g = --super["x"]; static h = ({ x: super["x"] } = { x: 1 }); static i = [super["x"]] = [1]; }); (@dec class C3 extends Base { static a = super[x]; static b = super[x] = 1; static c = super[x] += 1; static d = super[x]++; static e = super[x]--; static f = ++super[x]; static g = --super[x]; static h = ({ x: super[x] } = { x: 1 }); static i = [super[x]] = [1]; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-classSuper.6.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; declare class Base { static method(...args: any[]): number; method(...args: any[]): number; } // none of the following should result in caching `super` (@dec class C extends Base { static m() { super.method(); } static get x() { return super.method(); } static set x(v: number) { super.method(); } constructor() { super(); super.method(); } a = super.method(); m() { super.method(); } get x() { return super.method(); } set x(v: number) { super.method(); } });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-commentPreservation.ts
TypeScript
// @target: esnext, es2022, es2015 // @module: esnext // @noEmitHelpers: true // @noTypesAndSymbols: true declare var dec: any; /*1*/ ( /*2*/ @dec /*3*/ @dec /*4*/ class C { /*5*/ @dec /*6*/ @dec /*7*/ method() {} /*8*/ @dec /*9*/ @dec /*10*/ get x() { return 1; } /*11*/ @dec /*12*/ @dec /*13*/ set x(value: number) { } /*14*/ @dec /*15*/ @dec /*16*/ y = 1; /*17*/ @dec /*18*/ @dec /*19*/ accessor z = 1; /*20*/ @dec /*21*/ @dec /*22*/ static #method() {} /*23*/ @dec /*24*/ @dec /*25*/ static get #x() { return 1; } /*26*/ @dec /*27*/ @dec /*28*/ static set #x(value: number) { } /*29*/ @dec /*30*/ @dec /*31*/ static #y = 1; /*32*/ @dec /*33*/ @dec /*34*/ static accessor #z = 1; } );
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.1.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts declare var dec: any; // uses: __esDecorate, __runInitializers, __setFunctionName export const C = @dec class {}; // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.10.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; var C; // uses __esDecorate, __runInitializers, __setFunctionName C &&= @dec class {}; // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.11.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; var C; // uses __esDecorate, __runInitializers, __setFunctionName C ??= @dec class {}; // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.12.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; // uses __esDecorate, __runInitializers, __setFunctionName function f(C = @dec class {}) {} // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.13.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts declare var dec: any; // uses __esDecorate, __runInitializers, __setFunctionName export const C = ((@dec class {})); // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.14.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; declare var x: any; // uses __esDecorate, __runInitializers, __setFunctionName, __propKey ({ [x]: @dec class {} }); // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.15.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; // uses __esDecorate, __runInitializers, __setFunctionName class C { D = @dec class {} } // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.17.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; declare var x: any; var C; // uses __esDecorate, __runInitializers, __setFunctionName, __propKey ({ [x]: C = @dec class {} } = {}); // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.2.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts declare var dec: any; // uses: __esDecorate, __runInitializers export const C = @dec class C {}; // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.3.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts declare var dec: any; // uses __esDecorate, __runInitializers, __setFunctionName export default (@dec class {}); // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.4.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; var C; // uses __esDecorate, __runInitializers, __setFunctionName C = @dec class {}; // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.5.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; var C; // uses __esDecorate, __runInitializers, __setFunctionName [C = @dec class {}] = []; // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.6.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; // uses __esDecorate, __runInitializers, __setFunctionName ({ C: @dec class {} }); // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.7.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; var C; // uses __esDecorate, __runInitializers, __setFunctionName ({ C: C = @dec class {} } = {}); // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.8.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; var C; // uses __esDecorate, __runInitializers, __setFunctionName ({ C = @dec class {} } = {}); // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-missingEmitHelpers-classDecorator.9.ts
TypeScript
// @target: es2022 // @importHelpers: true // @module: commonjs // @moduleResolution: classic // @noTypesAndSymbols: true // @filename: main.ts export {}; declare var dec: any; var C; // uses __esDecorate, __runInitializers, __setFunctionName C ||= @dec class {}; // @filename: tslib.d.ts export {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-namedEvaluation.1.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; let x: any; // 13.15.2 RS: Evaluation // AssignmentExpression : LeftHandSideExpression `=` AssignmentExpression x = @dec class { }; x = class { @dec y: any; }; // 13.15.2 RS: Evaluation // AssignmentExpression : LeftHandSideExpression `&&=` AssignmentExpression x &&= @dec class { }; x &&= class { @dec y: any; }; // 13.15.2 RS: Evaluation // AssignmentExpression : LeftHandSideExpression `||=` AssignmentExpression x ||= @dec class { }; x ||= class { @dec y: any; }; // 13.15.2 RS: Evaluation // AssignmentExpression : LeftHandSideExpression `??=` AssignmentExpression x ??= @dec class { }; x ??= class { @dec y: any; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-namedEvaluation.10.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any, f: any; // 10.2.1.3 RS: EvaluateBody // Initializer : `=` AssignmentExpression { class C { static x = @dec class {}; } } { class C { static "x" = @dec class {}; } } { class C { static 0 = @dec class {}; } } { class C { static ["x"] = @dec class {}; } } { class C { static [0] = @dec class {}; } } // @ts-ignore { class C { static [f()] = @dec class {}; } } // __proto__ is not special in a class field { class C { static __proto__ = @dec class {}; } } { class C { static "__proto__" = @dec class {}; } } { class C { static x = class { @dec y: any }; } } { class C { static "x" = class { @dec y: any }; } } { class C { static 0 = class { @dec y: any }; } } { class C { static ["x"] = class { @dec y: any }; } } { class C { static [0] = class { @dec y: any }; } } // @ts-ignore { class C { static [f()] = @dec class {}; } } // __proto__ is not special in a class field { class C { static __proto__ = class { @dec y: any }; } } { class C { static "__proto__" = class { @dec y: any }; } } // ensure nested named evaluation happens when field is also transformed { class C { @dec static x = @dec class {}; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-namedEvaluation.11.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; // No NamedEvaluation, no class name (@dec class {}); (class { @dec y: any }); // No NamedEvaluation, class name (@dec class C {}); (class C { @dec y: any });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-namedEvaluation.2.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; let x: any, f: any; // 13.2.5.5 RS: PropertyDefinitionEvaluation // PropertyAssignment : PropertyName `:` AssignmentExpression ({ x: @dec class { } }); ({ x: class { @dec y: any; } }); ({ "x": @dec class { } }); ({ "x": class { @dec y: any; } }); ({ 0: @dec class { } }); ({ 0: class { @dec y: any; } }); ({ ["x"]: @dec class { } }); ({ ["x"]: class { @dec y: any; } }); ({ [0]: @dec class { } }); ({ [0]: class { @dec y: any; } }); ({ [f()]: @dec class { } }); ({ [f()]: class { @dec y: any; } }); // __proto__ setters do not perform NamedEvaluation ({ __proto__: @dec class { } }); ({ "__proto__": @dec class { } }); // "__proto__" in a computed property name *does* perform NamedEvaluation ({ ["__proto__"]: @dec class { } });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-namedEvaluation.3.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any; // 14.3.1.2 RS: Evaluation // LexicalBinding : BindingIdentifier Initializer { let x = @dec class { }; } { let x = class { @dec y: any; }; } { const x = @dec class { }; } { const x = class { @dec y: any; }; } // 14.3.2.1 RS: Evaluation // VariableDeclaration : BindingIdentifier Initializer { var x2 = @dec class { }; } { var x1 = class { @dec y: any; }; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-namedEvaluation.4.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any, obj: any; // 8.6.3 RS: IteratorBindingInitialization // SingleNameBinding : BindingIdentifier Initializer? { const [x = @dec class { }] = obj; } { const [x = class { @dec y: any; }] = obj; } // 14.3.3.3 RS: KeyedBindingInitialization // SingleNameBinding : BindingIdentifier Initializer? { const { x = @dec class { } } = obj; } { const { x = class { @dec y: any; } } = obj; } { const { y: x = @dec class { } } = obj; } { const { y: x = class { @dec y: any; } } = obj; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-namedEvaluation.5.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any, obj: any, x: any; // 13.15.5.3 RS: PropertyDestructuringAssignmentEvaluation // AssignmentProperty : IdentifierReference Initializer? ({ x = @dec class { } } = obj); ({ x = class { @dec y: any; } } = obj);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-namedEvaluation.6.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any, obj: any, x: any; // 13.15.5.6 RS: KeyedDestructuringAssignmentEvaluation // AssignmentElement : DestructuringAssignmentTarget Initializer? ({ y: x = @dec class { } } = obj); ({ y: x = class { @dec y: any; } } = obj);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-namedEvaluation.7.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true declare let dec: any, obj: any, x: any; // 13.15.5.6 RS: KeyedDestructuringAssignmentEvaluation // AssignmentElement : DestructuringAssignmentTarget Initializer? [x = @dec class { }] = obj; [x = class { @dec y: any; }] = obj;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-namedEvaluation.8.ts
TypeScript
// @target: es2022 // @noEmitHelpers: true // @noTypesAndSymbols: true // @filename: a.ts declare let dec: any; // 16.2.3.7 RS: Evaluation // ExportDeclaration : `export` `default` AssignmentExpression `;` export default (@dec class { }); // @filename: b.ts declare let dec: any; // 16.2.3.7 RS: Evaluation // ExportDeclaration : `export` `default` AssignmentExpression `;` export default (class { @dec y: any });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-classExpression-namedEvaluation.9.ts
TypeScript
// @target: es2022 // @module: commonjs // @noEmitHelpers: true // @noTypesAndSymbols: true // @filename: a.ts declare let dec: any; export = @dec class { }; // @filename: b.ts declare let dec: any; export = class { @dec y: any };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-contextualTypes.2.ts
TypeScript
// @target: esnext // @module: esnext class C { @boundMethodLogger("Yadda", /*bound*/ true) foo() { this.fooHelper(); } fooHelper() { console.log("Behold! The actual method implementation!") } }; export { C }; function boundMethodLogger<This, Args extends any[], Return>(source: string, bound = true) { return function loggedDecorator( target: (this: This, ...args: Args) => Return, context: ClassMethodDecoratorContext<This, (this: This, ...args: Args) => Return> ): ((this: This, ...args: Args) => Return) { if (bound) { context.addInitializer(function () { (this as any)[context.name] = (this as any)[context.name].bind(this); }); } return function (this, ...args) { console.log(`<${source}>: I'm logging stuff from ${context.name.toString()}!`); return target.apply(this, args); } } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-contextualTypes.ts
TypeScript
// @target: esnext @((t, c) => { }) class C { @((t, c) => { }) static f() {} @((t, c) => { }) static #f() {} @((t, c) => { }) static get x() { return 1; } @((t, c) => { }) static set x(value) { } @((t, c) => { }) static get #x() { return 1; } @((t, c) => { }) static set #x(value) { } @((t, c) => { }) static accessor y = 1; @((t, c) => { }) static accessor #y = 1; @((t, c) => { }) static z = 1; @((t, c) => { }) static #z = 1; @((t, c) => { }) g() {} @((t, c) => { }) #g() {} @((t, c) => { }) get a() { return 1; } @((t, c) => { }) set a(value) { } @((t, c) => { }) get #a() { return 1; } @((t, c) => { }) set #a(value) { } @((t, c) => { }) accessor b = 1; @((t, c) => { }) accessor #b = 1; @((t, c) => { }) c = 1; @((t, c) => { }) #c = 1; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-decoratorExpression.1.ts
TypeScript
// @target: esnext // @experimentalDecorators: * // @noEmitHelpers: true // @noTypesAndSymbols: true declare let x: any; { @x().y class C {} } { @new x class C {} } { @x().y() class C {} } { @x?.y class C {} } { @x?.y() class C {} } { @x?.["y"] class C {} } { @x?.() class C {} } { @x`` class C {} } { @x``() class C {} } { @x.y`` class C {} } { @x.y``() class C {} } { class C { @x().y m() {} } } { class C { @new x m() {} } } { class C { @x().y() m() {} } } { class C { @x?.y m() {} } } { class C { @x?.y() m() {} } } { class C { @x?.["y"] m() {} } } { class C { @x?.() m() {} } } { class C { @x`` m() {} } } { class C { @x``() m() {} } } { class C { @x.y`` m() {} } } { class C { @x.y``() m() {} } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-decoratorExpression.2.ts
TypeScript
// @target: esnext // @experimentalDecorators: * // @noEmitHelpers: true // @noTypesAndSymbols: true declare let x: any; declare let g: <T>(...args: any) => any; declare let h: () => <T>(...args: any) => any; { @x! class C {} } { @x.y! class C {} } { @x!.y class C {} } { @g<number>() class C {} } { @(g<number>) class C {} } { @(h()<number>) class C {} } { @(x().y) class C {} } { @(x().y()) class C {} } { @(x``) class C {} } { @(x.y``) class C {} } { @(x?.y!) class C {} } { @(x["y"]) class C {} } { @(x?.["y"]) class C {} } { class C { @x! m() {} } } { class C { @x.y! m() {} } } { class C { @x!.y m() {} } } { class C { @g<number>() m() {} } } { class C { @(g<number>) m() {} } } { class C { @(h()<number>) m() {} } } { class C { @(x().y) m() {} } } { class C { @(x().y()) m() {} } } { class C { @(x``) m() {} } } { class C { @(x.y``) m() {} } } { class C { @(x?.y!) m() {} } } { class C { @(x["y"]) m() {} } } { class C { @(x?.["y"]) m() {} } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-emitDecoratorMetadata.ts
TypeScript
// @target: esnext, es2022, es2015, es5 // @noEmitHelpers: true // @emitDecoratorMetadata: true // @noTypesAndSymbols: true declare let dec: any; @dec class C { constructor(x: number) {} @dec method(x: number) {} @dec set x(x: number) {} @dec y: number; @dec static method(x: number) {} @dec static set x(x: number) {} @dec static y: number; } (@dec class C { constructor(x: number) {} @dec method(x: number) {} @dec set x(x: number) {} @dec y: number; @dec static method(x: number) {} @dec static set x(x: number) {} @dec static y: number; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecorators-preservesThis.ts
TypeScript
// @target: es2022 // https://github.com/microsoft/TypeScript/issues/53752 declare class DecoratorProvider { decorate<T>(this: DecoratorProvider, v: T, ctx: DecoratorContext): T; } declare const instance: DecoratorProvider; // preserve `this` for access class C { @instance.decorate method1() { } @(instance["decorate"]) method2() { } // even in parens @((instance.decorate)) method3() { } } // preserve `this` for `super` access class D extends DecoratorProvider { m() { class C { @(super.decorate) method1() { } @(super["decorate"]) method2() { } @((super.decorate)) method3() { } } } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecoratorsMetadata1.ts
TypeScript
// @target: es2022,es2015 // @noTypesAndSymbols: true // @lib: esnext // @filename: /foo.ts function meta(key: string, value: string) { return (_, context) => { context.metadata[key] = value; }; } @meta('a', 'x') class C { @meta('b', 'y') m() { } } C[Symbol.metadata].a; // 'x' C[Symbol.metadata].b; // 'y'
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecoratorsMetadata2.ts
TypeScript
// @target: es2022,es2015 // @noTypesAndSymbols: true // @lib: esnext // @filename: /foo.ts function meta(key: string, value: string) { return (_, context) => { context.metadata[key] = value; }; } @meta('a', 'x') class C { @meta('b', 'y') m() {} } C[Symbol.metadata].a; // 'x' C[Symbol.metadata].b; // 'y' class D extends C { @meta('b', 'z') m() {} } D[Symbol.metadata].a; // 'x' D[Symbol.metadata].b; // 'z'
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecoratorsMetadata3.ts
TypeScript
// @target: es2022,es2015 // @noTypesAndSymbols: true // @lib: esnext // @filename: /foo.ts function appendMeta(key: string, value: string) { return (_, context) => { const existing = context.metadata[key] ?? []; context.metadata[key] = [...existing, value]; }; } @appendMeta('a', 'x') class C { } @appendMeta('a', 'z') class D extends C { } C[Symbol.metadata].a; // ['x'] D[Symbol.metadata].a; // ['x', 'z']
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/esDecoratorsMetadata4.ts
TypeScript
// @target: es2022,es2015 // @noTypesAndSymbols: true // @lib: esnext // @filename: /foo.ts const PRIVATE_METADATA = new WeakMap(); function meta(key: string, value: string) { return (_, context) => { let metadata = PRIVATE_METADATA.get(context.metadata); if (!metadata) { metadata = {}; PRIVATE_METADATA.set(context.metadata, metadata); } metadata[key] = value; }; } @meta('a', 'x') class C { @meta('b', 'y') m() { } } PRIVATE_METADATA.get(C[Symbol.metadata]).a; // 'x' PRIVATE_METADATA.get(C[Symbol.metadata]).b; // 'y'
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University