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_transforms_proposal/tests/decorators/2022-03-accessors/static-public/output.js
JavaScript
var _init_a, _init_b, _computedKey, _init_computedKey, _initStatic; const dec = ()=>{}; _computedKey = 'c'; class Foo { static{ ({ e: [_init_a, _init_b, _init_computedKey, _initStatic] } = _apply_decs_2203_r(this, [ [ dec, 6, "a" ], ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-accessors/undecorated-private/input.js
JavaScript
const dec = () => {}; class Foo { accessor #a; accessor #b = 123; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-accessors/undecorated-private/output.js
JavaScript
const dec = ()=>{}; class Foo { #__a_1; get #a() { return this.#__a_1; } set #a(_v) { this.#__a_1 = _v; } #__b_2 = 123; get #b() { return this.#__b_2; } set #b(_v) { this.#__b_2 = _v; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-accessors/undecorated-public/input.js
JavaScript
const dec = () => {}; class Foo { accessor a; accessor b = 123; accessor ['c'] = 456; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-accessors/undecorated-public/output.js
JavaScript
var _computedKey; const dec = ()=>{}; _computedKey = 'c'; class Foo { #___private_a_1; get a() { return this.#___private_a_1; } set a(_v) { this.#___private_a_1 = _v; } #___private_b_2 = 123; get b() { return this.#___private_b_2; } set b(_v) { this.#_...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-accessors/undecorated-static-private/input.js
JavaScript
const dec = () => {}; class Foo { static accessor #a; static accessor #b = 123; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-accessors/undecorated-static-private/output.js
JavaScript
const dec = ()=>{}; class Foo { static #__a_1; static get #a() { return this.#__a_1; } static set #a(_v) { this.#__a_1 = _v; } static #__b_2 = 123; static get #b() { return this.#__b_2; } static set #b(_v) { this.#__b_2 = _v; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-accessors/undecorated-static-public/input.js
JavaScript
const dec = () => {}; class Foo { static accessor a; static accessor b = 123; static accessor ['c'] = 456; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-accessors/undecorated-static-public/output.js
JavaScript
var _computedKey; const dec = ()=>{}; _computedKey = 'c'; class Foo { static #___private_a_1; static get a() { return this.#___private_a_1; } static set a(_v) { this.#___private_a_1 = _v; } static #___private_b_2 = 123; static get b() { return this.#___private_b_2; ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/.replacement-static-installed-on-correct-class/exec.js
JavaScript
let hasX, hasM, OriginalFoo; class Bar {} function dec(Foo) { OriginalFoo = Foo; return Bar; } @dec class Foo { static #x; static #m() {} static x; static m() {} static { hasX = o => #x in o; hasM = o => #m in o; } } expect(hasX(Bar)).toBe(true); expect(hasM(Bar)).toBe(true); expect(hasX(O...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/.replacement-static-installed-on-correct-class/input.js
JavaScript
const dec = () => {}; let hasX, hasM; @dec class Foo { static #x; static #m() {} static x; static m() {} static { hasX = o => #x in o; hasM = o => #m in o; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/.replacement-static-installed-on-correct-class/output.js
JavaScript
var _x, _m, _class, __; var _initClass; const dec = ()=>{}; let hasX, hasM; let _Foo; new (_x = /*#__PURE__*/ new WeakMap(), _m = /*#__PURE__*/ new WeakSet(), _class = class extends _identity { constructor(){ var _temp; _temp = super(_Foo), _class_private_method_init(this, _m), _class_private_field_...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/.replacement-static-this/exec.js
JavaScript
class Bar {} let _this, _this2, _this3; @(() => Bar) class Foo { static { _this = this; } static field = (_this2 = this); static { _this3 = this; } } expect(_this).toBe(Bar); expect(_this2).toBe(Bar); expect(_this3).toBe(Bar);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/.replacement-static-this/input.js
JavaScript
const dec = () => {}; @dec class Foo { static { this } static field = this; static { this } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/.replacement-static-this/output.js
JavaScript
var _class, __; var _initClass; const dec = ()=>{}; let _Foo; new (_class = class extends _identity { constructor(){ var _temp; _temp = super(_Foo), _define_property(this, "field", ((()=>{ this; })(), this)), _temp, (()=>{ this; })(), _initClass(); } }, __...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/decorator-access-modified-fields/exec.js
JavaScript
var value; const classDec = (Class) => { value = (new Class).m; return Class }; const memberDec = () => () => 42; @classDec class C { @memberDec m; } expect(value).toBe(42);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/decorator-access-modified-fields/input.js
JavaScript
var value; const classDec = (Class) => { value = (new Class).p; return Class }; const memberDec = () => () => 42; @classDec class C { @memberDec m; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/decorator-access-modified-fields/output.js
JavaScript
var _initClass, _init_m; var value; const classDec = (Class)=>{ value = (new Class).p; return Class; }; const memberDec = ()=>()=>42; let _C; class C { constructor(){ _define_property(this, "m", _init_m(this)); } } ({ e: [_init_m], c: [_C, _initClass] } = _apply_decs_2203_r(C, [ [ me...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/decorator-access-modified-methods/exec.js
JavaScript
var value; const classDec = (Class) => { value = (new Class).m(); return Class }; const memberDec = () => () => 42; @classDec class C { @memberDec m() {}; } expect(value).toBe(42);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/decorator-access-modified-methods/input.js
JavaScript
var value; const classDec = (Class) => { value = (new Class).m(); return Class }; const memberDec = () => () => 42; @classDec class C { @memberDec m() {}; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/decorator-access-modified-methods/output.js
JavaScript
var _initClass, _initProto; var value; const classDec = (Class)=>{ value = (new Class).m(); return Class; }; const memberDec = ()=>()=>42; let _C; class C { m() {} constructor(){ _initProto(this); } } ({ e: [_initProto], c: [_C, _initClass] } = _apply_decs_2203_r(C, [ [ memberDec...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/expressions-static-blocks/input.js
JavaScript
const dec = () => {}; const A = @dec class A { static {} } const B = @dec class C { static {} } const D = @dec class { static {} } const E = (@dec class { static {} }, 123); const F = [@dec class G { static {} }, @dec class { static {} }]; const H = @dec class extends I { static {} }; const J = @dec class K extends L {...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/expressions-static-blocks/output.js
JavaScript
var _A, _C, _class, _class1, _G, _class2, _class3, _K; var _initClass, _A1, _initClass1, _C1, _initClass2, _class4, _initClass3, _class5, _initClass4, _G1, _initClass5, _class6, _initClass6, _class7, _I, _initClass7, _K1, _L; const dec = ()=>{}; const A = ((_A = class A { }, { c: [_A1, _initClass] } = _apply_decs_2203_...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/expressions/input.js
JavaScript
const dec = () => {}; const A = @dec class A {} const B = @dec class C {} const D = @dec class {} const E = (@dec class {}, 123); const F = [@dec class G {}, @dec class {}]; const H = @dec class extends I {}; const J = @dec class K extends L {}; function classFactory() { return @dec class {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/expressions/output.js
JavaScript
var _A, _C, _class, _class1, _G, _class2, _class3, _K; var _initClass, _A1, _initClass1, _C1, _initClass2, _class4, _initClass3, _class5, _initClass4, _G1, _initClass5, _class6, _initClass6, _class7, _I, _initClass7, _K1, _L; const dec = ()=>{}; const A = ((_A = class A { }, { c: [_A1, _initClass] } = _apply_decs_2203_...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/inheritance/exec.js
JavaScript
let count = 0; function dec1(Klass) { expect(++count).toBe(1); expect(Klass.name).toBe('Bar'); } @dec1 class Bar {} function dec2(Klass) { expect(++count).toBe(2); expect(Klass.name).toBe('Foo'); expect(Object.getPrototypeOf(Klass)).toBe(Bar); } @dec2 class Foo extends Bar {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/inheritance/input.js
JavaScript
const dec1 = () => {}; const dec2 = () => {}; @dec1 class Bar {} @dec2 class Foo extends Bar {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/inheritance/output.js
JavaScript
var _initClass, _initClass1, _Bar; const dec1 = ()=>{}; const dec2 = ()=>{}; let _Bar1; class Bar { } ({ c: [_Bar1, _initClass] } = _apply_decs_2203_r(Bar, [], [ dec1 ])); _initClass(); let _Foo; class Foo extends (_Bar = _Bar1) { } ({ c: [_Foo, _initClass1] } = _apply_decs_2203_r(Foo, [], [ dec2 ], _Bar)); _in...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/initializers/exec.js
JavaScript
function dec1(Foo, { addInitializer }) { expect(Foo.field).toBe(undefined); addInitializer(() => { Foo.initField = 123; }); } @dec1 class Foo { static { expect(this.initField).toBe(undefined); } static field = 123; } expect(Foo.initField).toBe(123); expect(Foo.field).toBe(123); function dec2(Bar...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/initializers/input.js
JavaScript
const dec = () => {}; @dec class Foo { static field = 123; } @dec class Bar extends Foo { static { this.otherField = 456; } static field = 123; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/initializers/output.js
JavaScript
var _class, _class1; var _initClass, _initClass1, _Foo; const dec = ()=>{}; let _Foo1; new (_class = class extends _identity { constructor(){ super(_Foo1), _initClass(); } }, (()=>{ class Foo { } ({ c: [_Foo1, _initClass] } = _apply_decs_2203_r(Foo, [], [ dec ])); _define_pro...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/replacement-with-expr/exec.js
JavaScript
let replaced; function dec(Klass) { replaced = class extends Klass {}; return replaced; } const Foo = @dec class Bar { static bar = new Bar(); }; const foo = new Foo(); expect(Foo).toBe(replaced); expect(Foo.bar).toBeInstanceOf(replaced); expect(foo).toBeInstanceOf(replaced);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/replacement-with-expr/input.js
JavaScript
const dec = () => {}; const Foo = @dec class Bar { bar = new Bar(); }; const foo = new Foo();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/replacement-with-expr/output.js
JavaScript
var _Bar; var _initClass, _Bar1; const dec = ()=>{}; const Foo = ((_Bar = class Bar { constructor(){ _define_property(this, "bar", new _Bar1()); } }, { c: [_Bar1, _initClass] } = _apply_decs_2203_r(_Bar, [], [ dec ]), _initClass(), _Bar), _Bar1); const foo = new Foo();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/replacement/exec.js
JavaScript
let replaced; function dec(Klass) { replaced = class extends Klass {}; return replaced; } @dec class Foo { static foo = new Foo(); } const foo = new Foo(); expect(Foo).toBe(replaced); expect(Foo.foo).toBeInstanceOf(replaced); expect(foo).toBeInstanceOf(replaced);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/replacement/input.js
JavaScript
const dec = () => {}; @dec class Foo { static foo = new Foo(); } const foo = new Foo();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes--to-es2015/replacement/output.js
JavaScript
var _class; var _initClass; const dec = ()=>{}; let _Foo; new (_class = class extends _identity { constructor(){ super(_Foo), _initClass(); } }, (()=>{ class Foo { } ({ c: [_Foo, _initClass] } = _apply_decs_2203_r(Foo, [], [ dec ])); _define_property(Foo, "foo", new _Foo()); ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/decorator-access-modified-fields/exec.js
JavaScript
var value; const classDec = (Class) => { value = (new Class).m; return Class }; const memberDec = () => () => 42; @classDec class C { @memberDec m; } expect(value).toBe(42);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/decorator-access-modified-fields/input.js
JavaScript
var value; const classDec = (Class) => { value = (new Class).p; return Class }; const memberDec = () => () => 42; @classDec class C { @memberDec m; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/decorator-access-modified-fields/output.js
JavaScript
var _initClass, _init_m; var value; const classDec = (Class)=>{ value = (new Class).p; return Class; }; const memberDec = ()=>()=>42; let _C; class C { static{ ({ e: [_init_m] , c: [_C, _initClass] } = _apply_decs_2203_r(this, [ [ memberDec, 0, ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/decorator-access-modified-methods/exec.js
JavaScript
var value; const classDec = (Class) => { value = (new Class).m(); return Class }; const memberDec = () => () => 42; @classDec class C { @memberDec m() {}; } expect(value).toBe(42);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/decorator-access-modified-methods/input.js
JavaScript
var value; const classDec = (Class) => { value = (new Class).m(); return Class }; const memberDec = () => () => 42; @classDec class C { @memberDec m() {}; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/decorator-access-modified-methods/output.js
JavaScript
var _initClass, _initProto; var value; const classDec = (Class)=>{ value = (new Class).m(); return Class; }; const memberDec = ()=>()=>42; let _C; class C { static{ ({ e: [_initProto] , c: [_C, _initClass] } = _apply_decs_2203_r(this, [ [ memberDec, 2, ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/expressions-static-blocks/input.js
JavaScript
const dec = () => {}; const A = @dec class A { static {} } const B = @dec class C { static {} } const D = @dec class { static {} } const E = (@dec class { static {} }, 123); const F = [@dec class G { static {} }, @dec class { static {} }]; const H = @dec class extends I { static {} }; const J = @dec class K extends L {...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/expressions-static-blocks/output.js
JavaScript
var _initClass, _A, _initClass1, _C, _initClass2, _class, _initClass3, _class1, _initClass4, _G, _initClass5, _class2, _initClass6, _class3, _I, _initClass7, _K, _L; const dec = ()=>{}; const A = (class A { static{ ({ c: [_A, _initClass] } = _apply_decs_2203_r(this, [], [ dec ])); } ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/expressions/input.js
JavaScript
const dec = () => {}; const A = @dec class A {} const B = @dec class C {} const D = @dec class {} const E = (@dec class {}, 123); const F = [@dec class G {}, @dec class {}]; const H = @dec class extends I {}; const J = @dec class K extends L {}; function classFactory() { return @dec class {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/expressions/output.js
JavaScript
var _initClass, _A, _initClass1, _C, _initClass2, _class, _initClass3, _class1, _initClass4, _G, _initClass5, _class2, _initClass6, _class3, _I, _initClass7, _K, _L; const dec = ()=>{}; const A = (class A { static{ ({ c: [_A, _initClass] } = _apply_decs_2203_r(this, [], [ dec ])); } ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/inheritance/input.js
JavaScript
const dec = () => {}; @dec1 class Bar {} @dec2 class Foo extends Bar {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/inheritance/output.js
JavaScript
var _initClass, _initClass1, _Bar; const dec = ()=>{}; let _Bar1; class Bar { static{ ({ c: [_Bar1, _initClass] } = _apply_decs_2203_r(this, [], [ dec1 ])); } static{ _initClass(); } } let _Foo; class Foo extends (_Bar = _Bar1) { static{ ({ c: [_Foo, _init...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/initializers/input.js
JavaScript
const dec = () => {}; @dec class Foo { static field = 123; } @dec class Bar extends Foo { static { this.otherField = 456; } static field = 123; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/initializers/output.js
JavaScript
var _initClass, _initClass1, _Foo; const dec = ()=>{}; let _Foo1; new class extends _identity { constructor(){ super(_Foo1), _initClass(); } static{ class Foo { static{ ({ c: [_Foo1, _initClass] } = _apply_decs_2203_r(this, [], [ dec ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/replacement-static-installed-on-correct-class/input.js
JavaScript
const dec = () => {}; let hasX, hasM; @dec class Foo { static #x; static #m() {} static x; static m() {} static { hasX = o => #x in o; hasM = o => #m in o; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/replacement-static-installed-on-correct-class/output.js
JavaScript
var _initClass; const dec = ()=>{}; let hasX, hasM; let _Foo; new class extends _identity { constructor(){ super(_Foo), (()=>{ hasX = (o)=>#x in o; hasM = (o)=>#m in o; })(), _initClass(); } static{ class Foo { static{ ({ c: [_Foo, ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/replacement-static-this/input.js
JavaScript
const dec = () => {}; @dec class Foo { static { this } static field = this; static { this } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/replacement-static-this/output.js
JavaScript
var _initClass; const dec = ()=>{}; let _Foo; new class extends _identity { constructor(){ super(_Foo), (()=>{ this; })(), _initClass(); } static{ class Foo { static{ ({ c: [_Foo, _initClass] } = _apply_decs_2203_r(this, [], [ ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/replacement-with-expr/input.js
JavaScript
const dec = () => {}; const Foo = @dec class Bar { bar = new Bar(); }; const foo = new Foo();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/replacement-with-expr/output.js
JavaScript
var _initClass, _Bar; const dec = ()=>{}; const Foo = (class Bar { static{ ({ c: [_Bar, _initClass] } = _apply_decs_2203_r(this, [], [ dec ])); } bar = new _Bar(); static{ _initClass(); } }, _Bar); const foo = new Foo();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/replacement/input.js
JavaScript
const dec = () => {}; @dec class Foo { static foo = new Foo(); } const foo = new Foo();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-classes/replacement/output.js
JavaScript
var _initClass; const dec = ()=>{}; let _Foo; new class extends _identity { constructor(){ super(_Foo), _initClass(); } static{ class Foo { static{ ({ c: [_Foo, _initClass] } = _apply_decs_2203_r(this, [], [ dec ])); ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/.method-and-field/exec.js
JavaScript
let elements = []; function dec(val, context) { elements.push({ val, context }); } class Foo { @dec a = 123; @dec a() { return 1; } } expect(elements).toHaveLength(2); expect(elements[0].context.name).toBe("a"); expect(elements[0].val()).toBe(1); expect(elements[1].context.name).toBe("a"); expect(...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/.method-and-field/input.js
JavaScript
const dec = () => {}; class Foo { @dec a = 123; @dec a() { return 1; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/.method-and-field/output.js
JavaScript
var _init_a, _initProto; const dec = () => { }; class Foo { constructor() { defineProperty(this, "a", (_initProto(this), _init_a(this, 123))); } a() { return 1; } } [_init_a, _initProto] = _applyDecs2203R(Foo, [[dec, 2, "a"], [dec, 0, "a"]], []).e;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/computed-keys-same-ast/exec.js
JavaScript
var i = 0; function getKey() { return (i++).toString(); } let elements = []; function dec(fn, context) { elements.push({ fn, context }); } class Foo { @dec [getKey()]() { return 1; } @dec [getKey()]() { return 2; } } expect(elements).toHaveLength(2); expect(elements[0].context.name).toBe(...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/computed-keys-same-ast/input.js
JavaScript
const dec = () => {}; class Foo { @dec [getKey()]() { return 1; } @dec [getKey()]() { return 2; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/computed-keys-same-ast/output.js
JavaScript
var _computedKey, _computedKey1, _initProto; const dec = ()=>{}; _computedKey = getKey(), _computedKey1 = getKey(); let _computedKey2 = _computedKey, _computedKey3 = _computedKey1; class Foo { [_computedKey2]() { return 1; } [_computedKey3]() { return 2; } constructor(){ _ini...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/computed-keys-same-value/exec.js
JavaScript
expect(() => { var i = 0; var j = 0; function getKeyI() { return (i++).toString(); } function getKeyJ() { return (j++).toString(); } let elements = []; function dec(fn, context) { elements.push({ fn, context }); } class Foo { @dec [getKeyI()]() { return 1; } @d...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/computed-keys-same-value/input.js
JavaScript
const dec = () => {}; class Foo { @dec [getKeyI()]() { return 1; } @dec [getKeyJ()]() { return 2; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/computed-keys-same-value/output.js
JavaScript
var _computedKey, _computedKey1, _initProto; const dec = ()=>{}; _computedKey = getKeyI(), _computedKey1 = getKeyJ(); let _computedKey2 = _computedKey, _computedKey3 = _computedKey1; class Foo { [_computedKey2]() { return 1; } [_computedKey3]() { return 2; } constructor(){ _i...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/methods-with-same-key/exec.js
JavaScript
expect(() => { let elements = []; function dec(val, context) { elements.push({ val, context }); } class Foo { @dec a() { return 1; } @dec a() { return 2; } } }).toThrow("Attempted to decorate a public method/accessor that has the same name as a previously decorated p...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/methods-with-same-key/input.js
JavaScript
const dec = () => {}; class Foo { @dec a() { return 1; } @dec a() { return 2; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys--to-es2015/methods-with-same-key/output.js
JavaScript
var _initProto; const dec = ()=>{}; class Foo { a() { return 1; } a() { return 2; } constructor(){ _initProto(this); } } ({ e: [_initProto] } = _apply_decs_2203_r(Foo, [ [ dec, 2, "a" ], [ dec, 2, "a" ] ], []...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys/computed-keys-same-ast/input.js
JavaScript
const dec = () => {}; class Foo { @dec [getKey()]() { return 1; } @dec [getKey()]() { return 2; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys/computed-keys-same-ast/output.js
JavaScript
var _computedKey, _computedKey1, _initProto; const dec = ()=>{}; _computedKey = getKey(), _computedKey1 = getKey(); class Foo { static{ ({ e: [_initProto] } = _apply_decs_2203_r(this, [ [ dec, 2, _computedKey ], [ ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys/computed-keys-same-value/input.js
JavaScript
const dec = () => {}; class Foo { @dec [getKeyI()]() { return 1; } @dec [getKeyJ()]() { return 2; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys/computed-keys-same-value/output.js
JavaScript
var _computedKey, _computedKey1, _initProto; const dec = ()=>{}; _computedKey = getKeyI(), _computedKey1 = getKeyJ(); class Foo { static{ ({ e: [_initProto] } = _apply_decs_2203_r(this, [ [ dec, 2, _computedKey ], [ ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys/method-and-field/input.js
JavaScript
const dec = () => {}; class Foo { @dec a = 123; @dec a() { return 1; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys/method-and-field/output.js
JavaScript
var _init_a, _initProto; const dec = ()=>{}; class Foo { static{ ({ e: [_init_a, _initProto] } = _apply_decs_2203_r(this, [ [ dec, 2, "a" ], [ dec, 0, "a" ] ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys/methods-with-same-key/input.js
JavaScript
const dec = () => {}; class Foo { @dec a() { return 1; } @dec a() { return 2; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-duplicated-keys/methods-with-same-key/output.js
JavaScript
var _initProto; const dec = ()=>{}; class Foo { static{ ({ e: [_initProto] } = _apply_decs_2203_r(this, [ [ dec, 2, "a" ], [ dec, 2, "a" ] ], [])); } ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-exported/default-anonymous/input.mjs
JavaScript
export default @dec class A {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-exported/default-anonymous/output.mjs
JavaScript
var _initClass; let _A; class A { static{ ({ c: [_A, _initClass] } = _apply_decs_2203_r(this, [], [ dec ])); } static{ _initClass(); } } export { _A as default };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-exported/default-named/input.mjs
JavaScript
export default @dec class {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-exported/default-named/output.mjs
JavaScript
var _initClass; let __default; class _default { static{ ({ c: [__default, _initClass] } = _apply_decs_2203_r(this, [], [ dec ])); } static{ _initClass(); } } export { __default as default };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-exported/member-decorator/input.mjs
JavaScript
export class A { @dec x; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-exported/member-decorator/output.mjs
JavaScript
var _init_x; export class A { static{ ({ e: [_init_x] } = _apply_decs_2203_r(this, [ [ dec, 0, "x" ] ], [])); } x = _init_x(this); }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-exported/named/input.mjs
JavaScript
export @dec class A {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-exported/named/output.mjs
JavaScript
var _initClass; let _A; class A { static { ({ c: [_A, _initClass] } = _apply_decs_2203_r(this, [], [ dec ])); } static { _initClass(); } } export { _A as A };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-exported/no-decorators/input.mjs
JavaScript
export class A {} class B {} export { B };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-exported/no-decorators/output.mjs
JavaScript
export class A {} class B {} export { B };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields--to-es2015/private/exec.js
JavaScript
function dec(_v, context) { return function (v) { this[context.name + 'Context'] = context; return (v || 1) + 1; } } class Foo { @dec #a; @dec #b = 123; } let foo = new Foo(); const aContext = foo['#aContext']; const bContext = foo['#bContext']; expect(aContext.access.get.call(foo)).toBe(2); aC...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields--to-es2015/private/input.js
JavaScript
const dec = () => {}; class Foo { @dec #a; @dec #b = 123; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields--to-es2015/private/output.js
JavaScript
var _init_a, _init_b; const dec = ()=>{}; var _a = /*#__PURE__*/ new WeakMap(), _b = /*#__PURE__*/ new WeakMap(); class Foo { constructor(){ _class_private_field_init(this, _a, { writable: true, value: _init_a(this) }); _class_private_field_init(this, _b, { ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields--to-es2015/public/exec.js
JavaScript
function dec(_v, context) { return function (v) { this[context.name + 'Context'] = context; return (v || 1) + 1; } } class Foo { @dec a; @dec b = 123; @dec ['c'] = 456; } let foo = new Foo(); const aContext = foo['aContext']; const bContext = foo['bContext']; const cContext = foo['cContext'...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields--to-es2015/public/input.js
JavaScript
const dec = () => {}; class Foo { @dec a; @dec b = 123; @dec ['c'] = 456; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields--to-es2015/public/output.js
JavaScript
var _computedKey, _init_a, _init_b, _init__computedKey; const dec = ()=>{}; _computedKey = 'c'; let _computedKey1 = _computedKey; class Foo { constructor(){ _define_property(this, "a", _init_a(this)); _define_property(this, "b", _init_b(this, 123)); _define_property(this, _computedKey1, _ini...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields--to-es2015/static-private/exec.js
JavaScript
function dec(_v, context) { return function (v) { this[context.name + 'Context'] = context; return (v || 1) + 1; } } class Foo { @dec static #a; @dec static #b = 123; } const aContext = Foo['#aContext']; const bContext = Foo['#bContext']; expect(aContext.access.get.call(Foo)).toBe(2); aContext.a...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields--to-es2015/static-private/input.js
JavaScript
const dec = () => {}; class Foo { @dec static #a; @dec static #b = 123; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields--to-es2015/static-private/output.js
JavaScript
var _init_a, _init_b; const dec = ()=>{}; class Foo { } ({ e: [_init_a, _init_b] } = _apply_decs_2203_r(Foo, [ [ dec, 5, "a", function() { return _class_static_private_field_spec_get(this, Foo, _a); }, function(value) { _class_static_private_fi...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields--to-es2015/static-public/exec.js
JavaScript
function dec(_v, context) { return function (v) { this[context.name + 'Context'] = context; return (v || 1) + 1; } } class Foo { @dec static a; @dec static b = 123; @dec static ['c'] = 456; } const aContext = Foo['aContext']; const bContext = Foo['bContext']; const cContext = Foo['cContext']...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields--to-es2015/static-public/input.js
JavaScript
const dec = () => {}; class Foo { @dec static a; @dec static b = 123; @dec static ['c'] = 456; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University