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) {}
@d... | 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 ... | 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 {
... | 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.me... | 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 extend... | 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;
... | 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]();
sta... | 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--;
... | 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(); }
... | 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);
};
}
... | 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*/
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 = ... | 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: ts... | 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:... | 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
ex... | 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... | 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 t... | 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.t... | 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... | 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.m... | 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 ex... | 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;
... | 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]();
st... | 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--;
... | 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(); }
... | 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; }
... | 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
... | 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 {} } = {});
// @file... | 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 : LeftHandS... | 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 { sta... | 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": cl... | 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 ... | 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: KeyedBindingInit... | 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
// ... | 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: st... | 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... | 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``() c... | 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>) c... | 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: nu... | 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() { }
@(i... | 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.metada... | 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.metadat... | 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 ... | 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 = {... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.