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_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_1869_1.js
JavaScript
class TestClass { } _define_property(TestClass, "Something", 'hello'); _define_property(TestClass, "SomeProperties", { firstProp: TestClass.Something }); function someClassDecorator(c) { return c; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_1869_2.js
JavaScript
var _TestClass; var _class; let TestClass = _class = someClassDecorator((_class = (_TestClass = class TestClass { }, _define_property(_TestClass, "Something", 'hello'), _define_property(_TestClass, "SomeProperties", { firstProp: _TestClass.Something }), _TestClass)) || _class) || _class; function someClassDecorator(c) { return c; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_2021_1.js
JavaScript
class Item extends Component { constructor(props){ super(props), _define_property(this, "input", this.props.item); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_2481.js
JavaScript
class Foo { } var _prop1 = { writable: true, value: 42 }; var _prop2 = { writable: true, value: (()=>{ console.log(_class_static_private_field_spec_get(Foo, Foo, _prop1)); })() };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_3055_1.js
JavaScript
var _bar = /*#__PURE__*/ new WeakSet(), _baz = /*#__PURE__*/ new WeakSet(); export class Node { foo() { _class_private_method_get(this, _bar, bar).call(this, this); } constructor(){ _class_private_method_init(this, _bar); _class_private_method_init(this, _baz); } } function bar(parent) { var _parent_baz; _class_private_method_get(parent, _baz, baz).call(parent, this); _class_private_method_get(_parent_baz = parent.baz, _baz, baz).call(_parent_baz, this); } function baz(child) {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_308.js
JavaScript
function bar(props) {} class Foo { constructor(){ super(), _define_property(this, "onBar", ()=>{ bar(); }); bar(); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_3229_1.js
JavaScript
var _D = /*#__PURE__*/ new WeakMap(); class A { B() { 1; _class_private_field_update(C, _D).value++; E(function() {}); } constructor(){ _class_private_field_init(this, _D, { writable: true, value: void 0 }); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_3229_2.js
JavaScript
var _b = /*#__PURE__*/ new WeakMap(); class A { foo() { var _A; _class_private_field_set(_A = A, _b, _class_private_field_get(_A, _b) + 123); class B { foo() {} } } constructor(){ _class_private_field_init(this, _b, { writable: true, value: void 0 }); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_3368.js
JavaScript
var _a = /*#__PURE__*/ new WeakMap(), _bar = /*#__PURE__*/ new WeakSet(); class A { foo() { return class B { bar() { console.log(_class_private_field_get(this, _a), _class_static_private_field_spec_get(this, A, _b), _class_private_method_get(this, _bar, bar)); } }; } constructor(){ _class_private_method_init(this, _bar); _class_private_field_init(this, _a, { writable: true, value: 'fff' }); } } var _b = { writable: true, value: 123 }; function bar() {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_342.js
JavaScript
let Foo = function Foo(bar) { "use strict"; _class_call_check(this, Foo); _define_property(this, "qux", { frob: (bar)=>{} }); this._bar = bar; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_3618.js
JavaScript
var _a = /*#__PURE__*/ new WeakMap(); class MyClass { constructor(){ _class_private_field_init(this, _a, { get: get_a, set: set_a }); } } var _b = { get: get_b, set: set_b }; function get_a() {} function set_a(x) {} function get_b() {} function set_b(x) {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_443.js
JavaScript
var MODE = 1; class foo { constructor(){ this.mode = MODE; } } _define_property(foo, "MODE", MODE);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_4473.js
JavaScript
var test1 = class X { [Symbol.toStringTag]() {} }; function a() { const b = class Y { x() {} }; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_6305.js
JavaScript
class x { } var _x = { writable: true, value: _set(_get_prototype_of(x), "x", 0, x, true) };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_8003.js
JavaScript
var _priv = /*#__PURE__*/ new WeakMap(); class Foo { search() { var _this, _this1, _ref; (_this = _class_private_field_get(_ref = _this1 = this, _priv)) === null || _this === void 0 ? void 0 : _this.call(_this1); } constructor(){ _class_private_field_init(this, _priv, { writable: true, value: void 0 }); } } console.log(new Foo().search());
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/loose_keyword_method.js
JavaScript
var _switch = /*#__PURE__*/ _class_private_field_loose_key("_switch"), _bar = /*#__PURE__*/ _class_private_field_loose_key("_bar"); class TestCls { foo() { _class_private_field_loose_base(this, _bar)[_bar](); _class_private_field_loose_base(this, _switch)[_switch](); } constructor(){ Object.defineProperty(this, _switch, { value: __switch }); Object.defineProperty(this, _bar, { value: bar }); } } function __switch() { console.log("#switch called"); } function bar() { console.log("#bar called"); } export { TestCls }; let a = new TestCls; a.foo();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/loose_update.js
JavaScript
var _privateField = /*#__PURE__*/ _class_private_field_loose_key("_privateField"), _privateFieldValue = /*#__PURE__*/ _class_private_field_loose_key("_privateFieldValue"); class Cl { publicGetPrivateField() { return _class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue]; } publicSetPrivateField(newValue) { _class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue] = newValue; } get publicFieldValue() { return this.publicField; } set publicFieldValue(newValue) { this.publicField = newValue; } testUpdates() { _class_private_field_loose_base(this, _privateField)[_privateField] = 0; this.publicField = 0; _class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue] = _class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue]++; this.publicFieldValue = this.publicFieldValue++; ++_class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue]; ++this.publicFieldValue; _class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue] += 1; this.publicFieldValue += 1; _class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue] = -(_class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue] ** _class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue]); this.publicFieldValue = -(this.publicFieldValue ** this.publicFieldValue); } constructor(){ Object.defineProperty(this, _privateFieldValue, { get: get_privateFieldValue, set: set_privateFieldValue }); Object.defineProperty(this, _privateField, { writable: true, value: "top secret string" }); this.publicField = "not secret string"; } } function get_privateFieldValue() { return _class_private_field_loose_base(this, _privateField)[_privateField]; } function set_privateFieldValue(newValue) { _class_private_field_loose_base(this, _privateField)[_privateField] = newValue; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/nested_class_in_arrow.js
JavaScript
const a = ()=>{ class _class { foo() { return class B { constructor(){ _define_property(this, "b", 456); } }; } constructor(){ _define_property(this, "a", 123); } } return _class; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/nested_class_super_call_in_key.js
JavaScript
var Hello = function Hello() { "use strict"; _class_call_check(this, Hello); return { toString () { return 'hello'; } }; }; var Outer = /*#__PURE__*/ function(Hello) { "use strict"; _inherits(Outer, Hello); function Outer() { _class_call_check(this, Outer); var _this; var _ref = _this = _call_super(this, Outer); var Inner = function Inner() { _class_call_check(this, Inner); _define_property(this, _ref, "hello"); }; return _possible_constructor_return(_this, new Inner()); } return Outer; }(Hello); expect(new Outer().hello).toBe('hello');
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/nested_class_super_property_in_key.js
JavaScript
var Hello = /*#__PURE__*/ function() { "use strict"; function Hello() { _class_call_check(this, Hello); } _create_class(Hello, [ { key: "toString", value: function toString() { return 'hello'; } } ]); return Hello; }(); var Outer = /*#__PURE__*/ function(Hello) { "use strict"; _inherits(Outer, Hello); function Outer() { _class_call_check(this, Outer); var _this; _this = _call_super(this, Outer); var _super_toString = _get((_assert_this_initialized(_this), _get_prototype_of(Outer.prototype)), "toString", _this).call(_this); var Inner = function Inner() { _class_call_check(this, Inner); _define_property(this, _super_toString, 'hello'); }; return _possible_constructor_return(_this, new Inner()); } return Outer; }(Hello); expect(new Outer().hello).toBe('hello');
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_as_properties_basic.js
JavaScript
var _privateField = /*#__PURE__*/ _class_private_field_loose_key("_privateField"), _privateFieldValue = /*#__PURE__*/ _class_private_field_loose_key("_privateFieldValue"); class Cl { publicGetPrivateField() { return _class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue]; } publicSetPrivateField(newValue) { _class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue] = newValue; } constructor(){ Object.defineProperty(this, _privateFieldValue, { get: get_privateFieldValue, set: set_privateFieldValue }); Object.defineProperty(this, _privateField, { writable: true, value: "top secret string" }); this.publicField = "not secret string"; } } function get_privateFieldValue() { return _class_private_field_loose_base(this, _privateField)[_privateField]; } function set_privateFieldValue(newValue) { _class_private_field_loose_base(this, _privateField)[_privateField] = newValue; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_as_properties_getter_only.js
JavaScript
var _privateField = /*#__PURE__*/ _class_private_field_loose_key("_privateField"), _privateFieldValue = /*#__PURE__*/ _class_private_field_loose_key("_privateFieldValue"); class Cl { constructor(){ Object.defineProperty(this, _privateFieldValue, { get: get_privateFieldValue, set: void 0 }); Object.defineProperty(this, _privateField, { writable: true, value: 0 }); _class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue] = 1; [_class_private_field_loose_base(this, _privateFieldValue)[_privateFieldValue]] = [ 1 ]; } } function get_privateFieldValue() { return _class_private_field_loose_base(this, _privateField)[_privateField]; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_as_properties_static.js
JavaScript
var _foo = /*#__PURE__*/ _class_private_field_loose_key("_foo"), _f = /*#__PURE__*/ _class_private_field_loose_key("_f"), _bar = /*#__PURE__*/ _class_private_field_loose_key("_bar"); class Cl { } Object.defineProperty(Cl, _foo, { value: foo }); Object.defineProperty(Cl, _bar, { get: get_bar, set: void 0 }); Object.defineProperty(Cl, _f, { writable: true, value: 123 }); function foo() {} function get_bar() {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_assignment.js
JavaScript
var _foo = /*#__PURE__*/ new WeakMap(); var Foo = /*#__PURE__*/ function() { "use strict"; function Foo() { _class_call_check(this, Foo); _class_private_field_init(this, _foo, { writable: true, value: 0 }); } _create_class(Foo, [ { key: "test", value: function test(other) { var _other_obj; _class_private_field_set(this, _foo, _class_private_field_get(this, _foo) + 1); _class_private_field_set(this, _foo, 2); _class_private_field_set(_other_obj = other.obj, _foo, _class_private_field_get(_other_obj, _foo) + 1); _class_private_field_set(other.obj, _foo, 2); } } ]); return Foo; }();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_call.js
JavaScript
var _foo = /*#__PURE__*/ new WeakMap(); var Foo = /*#__PURE__*/ function() { "use strict"; function Foo() { _class_call_check(this, Foo); _class_private_field_init(this, _foo, { writable: true, value: function() { return this; } }); } _create_class(Foo, [ { key: "test", value: function test(other) { var _other_obj; _class_private_field_get(this, _foo).call(this); _class_private_field_get(_other_obj = other.obj, _foo).call(_other_obj); } } ]); return Foo; }();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_canonical.js
JavaScript
var _x = /*#__PURE__*/ new WeakMap(), _y = /*#__PURE__*/ new WeakMap(); var Point = /*#__PURE__*/ function() { "use strict"; function Point(x = 0, y = 0) { _class_call_check(this, Point); _class_private_field_init(this, _x, { writable: true, value: void 0 }); _class_private_field_init(this, _y, { writable: true, value: void 0 }); _class_private_field_set(this, _x, +x); _class_private_field_set(this, _y, +y); } _create_class(Point, [ { key: "x", get: function() { return _class_private_field_get(this, _x); }, set: function(value) { _class_private_field_set(this, _x, +value); } }, { key: "y", get: function() { return _class_private_field_get(this, _y); }, set: function(value) { _class_private_field_set(this, _y, +value); } }, { key: "equals", value: function equals(p) { return _class_private_field_get(this, _x) === _class_private_field_get(p, _x) && _class_private_field_get(this, _y) === _class_private_field_get(p, _y); } }, { key: "toString", value: function toString() { return `Point<${_class_private_field_get(this, _x)},${_class_private_field_get(this, _y)}>`; } } ]); return Point; }();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_class_method.js
JavaScript
var _foo = /*#__PURE__*/ new WeakSet(); class Foo { constructor(){ _class_private_method_init(this, _foo); } } function foo() {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_constructor_collision.js
JavaScript
var foo = "bar"; var _bar = /*#__PURE__*/ new WeakMap(); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); _class_private_field_init(this, _bar, { writable: true, value: foo }); var foo1 = "foo"; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_declaration_order.js
JavaScript
var _x = /*#__PURE__*/ new WeakMap(); var C = function C() { "use strict"; _class_call_check(this, C); _define_property(this, "y", _class_private_field_get(this, _x)); _class_private_field_init(this, _x, { writable: true, value: void 0 }); }; expect(()=>{ new C(); }).toThrow();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived.js
JavaScript
var _prop = /*#__PURE__*/ new WeakMap(); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); _class_private_field_init(this, _prop, { writable: true, value: "foo" }); }; var _prop1 = /*#__PURE__*/ new WeakMap(); var Bar = /*#__PURE__*/ function(Foo) { "use strict"; _inherits(Bar, Foo); function Bar() { _class_call_check(this, Bar); var _this; _this = _call_super(this, Bar, arguments), _class_private_field_init(_this, _prop1, { writable: true, value: "bar" }); return _this; } return Bar; }(Foo);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived_multiple_supers.js
JavaScript
var _bar = /*#__PURE__*/ new WeakMap(); var Foo = /*#__PURE__*/ function(Bar1) { "use strict"; _inherits(Foo, Bar1); function Foo() { _class_call_check(this, Foo); var _this; if (condition) { _this = _call_super(this, Foo), _class_private_field_init(_this, _bar, { writable: true, value: "foo" }); } else { _this = _call_super(this, Foo), _class_private_field_init(_this, _bar, { writable: true, value: "foo" }); } return _assert_this_initialized(_this); } return Foo; }(Bar);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_destructuring_array_pattern.js
JavaScript
var _client = /*#__PURE__*/ new WeakMap(); var Foo = function Foo(props) { "use strict"; _class_call_check(this, Foo); _class_private_field_init(this, _client, { writable: true, value: void 0 }); [_class_private_field_destructure(this, _client).value] = props; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_destructuring_array_pattern_1.js
JavaScript
var _client = /*#__PURE__*/ new WeakMap(); var Foo = function Foo(props) { "use strict"; _class_call_check(this, Foo); _class_private_field_init(this, _client, { writable: true, value: void 0 }); _class_private_field_set(this, _client, 1); [this.x = _class_private_field_get(this, _client), _class_private_field_destructure(this, _client).value, this.y = _class_private_field_get(this, _client)] = props; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_destructuring_array_pattern_2.js
JavaScript
var _client = /*#__PURE__*/ new WeakMap(); var Foo = function Foo(props) { "use strict"; _class_call_check(this, Foo); _class_private_field_init(this, _client, { writable: true, value: void 0 }); [x, ..._class_private_field_destructure(this, _client).value] = props; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_destructuring_array_pattern_3.js
JavaScript
var _client = /*#__PURE__*/ new WeakMap(); var Foo = function Foo(props) { "use strict"; _class_call_check(this, Foo); _class_private_field_init(this, _client, { writable: true, value: void 0 }); [_class_private_field_destructure(this, _client).value = 5] = props; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_destructuring_object_pattern_1.js
JavaScript
var _client = /*#__PURE__*/ new WeakMap(); var Foo = function Foo(props) { "use strict"; _class_call_check(this, Foo); _class_private_field_init(this, _client, { writable: true, value: void 0 }); _class_private_field_set(this, _client, 'foo'); ({ x: this.x = _class_private_field_get(this, _client), y: _class_private_field_destructure(this, _client).value, z: this.z = _class_private_field_get(this, _client) } = props); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_extracted_this.js
JavaScript
var foo = "bar"; var _bar = /*#__PURE__*/ new WeakMap(), _baz = /*#__PURE__*/ new WeakMap(); var Foo = function Foo(foo1) { "use strict"; _class_call_check(this, Foo); _class_private_field_init(this, _bar, { writable: true, value: this }); _class_private_field_init(this, _baz, { writable: true, value: foo }); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_foobar.js
JavaScript
var _scopedFunctionWithThis = /*#__PURE__*/ new WeakMap(); var Child = /*#__PURE__*/ function(Parent1) { "use strict"; _inherits(Child, Parent1); function Child() { _class_call_check(this, Child); var _this; _this = _call_super(this, Child), _class_private_field_init(_this, _scopedFunctionWithThis, { writable: true, value: ()=>{ _this.name = {}; } }); return _this; } return Child; }(Parent);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_instance.js
JavaScript
var _bar = /*#__PURE__*/ new WeakMap(); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); _class_private_field_init(this, _bar, { writable: true, value: "foo" }); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_instance_undefined.js
JavaScript
var _bar = /*#__PURE__*/ new WeakMap(); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); _class_private_field_init(this, _bar, { writable: true, value: void 0 }); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_multiple.js
JavaScript
var _x = /*#__PURE__*/ new WeakMap(), _y = /*#__PURE__*/ new WeakMap(); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); _class_private_field_init(this, _x, { writable: true, value: 0 }); _class_private_field_init(this, _y, { writable: true, value: _class_private_field_get(this, _x) }); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_native_classes.js
JavaScript
var _bar = /*#__PURE__*/ new WeakMap(); class Foo { static test() { return _class_static_private_field_spec_get(Foo, Foo, _foo); } test() { return _class_private_field_get(this, _bar); } constructor(){ _class_private_field_init(this, _bar, { writable: true, value: "bar" }); } } var _foo = { writable: true, value: "foo" };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_non_block_arrow_func.js
JavaScript
export default ((param)=>{ class App { getParam() { return param; } } var _props = { writable: true, value: { prop1: 'prop1', prop2: 'prop2' } }; return App; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_optional_chain_call.js
JavaScript
var _fieldFunc = /*#__PURE__*/ new WeakMap(); class A { test() { var _this, _this1, _ref; (_this = _class_private_field_get(_ref = _this1 = this, _fieldFunc)) === null || _this === void 0 ? void 0 : _this.call(_this1); } constructor(){ _class_private_field_init(this, _fieldFunc, { writable: true, value: void 0 }); _define_property(this, "x", 1); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_optional_chain_member.js
JavaScript
var _a = /*#__PURE__*/ new WeakMap(); class MyClass { foo(o) { o === null || o === void 0 ? void 0 : _class_private_field_get(o, _a); } constructor(){ _class_private_field_init(this, _a, { writable: true, value: void 0 }); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_optional_chain_member_loose.js
JavaScript
var _a = /*#__PURE__*/ new WeakMap(); class MyClass { foo(o) { o == null ? void 0 : _class_private_field_get(o, _a); } constructor(){ _class_private_field_init(this, _a, { writable: true, value: void 0 }); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_private_in_derived.js
JavaScript
var _outer = /*#__PURE__*/ new WeakMap(); var Outer = function Outer() { "use strict"; _class_call_check(this, Outer); var _this = this; _class_private_field_init(this, _outer, { writable: true, value: void 0 }); var Test = /*#__PURE__*/ function(_class_private_field_get1) { _inherits(Test, _class_private_field_get1); function Test() { _class_call_check(this, Test); return _call_super(this, Test, arguments); } return Test; }(_class_private_field_get(_this, _outer)); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_reevaluated.js
JavaScript
function classFactory() { var _foo, _Foo, _bar; return _foo = /*#__PURE__*/ new WeakMap(), _Foo = class Foo { instance() { return _class_private_field_get(this, _foo); } static() { return _class_static_private_field_spec_get(Foo, _Foo, _bar); } static instance(inst) { return _class_private_field_get(inst, _foo); } static static() { return _class_static_private_field_spec_get(Foo, _Foo, _bar); } constructor(){ _class_private_field_init(this, _foo, { writable: true, value: "foo" }); } }, _bar = { writable: true, value: "bar" }, _Foo; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_reference_in_other_property.js
JavaScript
var _two = /*#__PURE__*/ new WeakMap(), _private = /*#__PURE__*/ new WeakMap(), _four = /*#__PURE__*/ new WeakMap(); var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); _define_property(this, "one", _class_private_field_get(this, _private)); _class_private_field_init(this, _two, { writable: true, value: _class_private_field_get(this, _private) }); _class_private_field_init(this, _private, { writable: true, value: 0 }); _define_property(this, "three", _class_private_field_get(this, _private)); _class_private_field_init(this, _four, { writable: true, value: _class_private_field_get(this, _private) }); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_regression_t2983.js
JavaScript
var _class, _test; call((_class = class { }, _test = { writable: true, value: true }, _class)); class _class1 { } var _test1 = { writable: true, value: true }; export { _class1 as default };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_regression_t6719.js
JavaScript
function withContext(ComposedComponent) { var _WithContext, _propTypes; return _WithContext = class WithContext extends Component { }, _propTypes = { writable: true, value: { context: PropTypes.shape({ addCss: PropTypes.func, setTitle: PropTypes.func, setMeta: PropTypes.func }) } }, _WithContext; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_regression_t7364.js
JavaScript
var _myAsyncMethod; var _myAsyncMethod1 = /*#__PURE__*/ new WeakMap(); class MyClass { constructor(){ var _this = this; _class_private_field_init(this, _myAsyncMethod1, { writable: true, value: /*#__PURE__*/ _async_to_generator(function*() { console.log(_this); }) }); } } _myAsyncMethod = /*#__PURE__*/ new WeakMap(), class MyClass2 { constructor(){ var _this = this; _class_private_field_init(this, _myAsyncMethod, { writable: true, value: /*#__PURE__*/ _async_to_generator(function*() { console.log(_this); }) }); } }; var _myAsyncMethod2 = /*#__PURE__*/ new WeakMap(); class MyClass3 { constructor(){ var _this = this; _class_private_field_init(this, _myAsyncMethod2, { writable: true, value: /*#__PURE__*/ _async_to_generator(function*() { console.log(_this); }) }); } } export { MyClass3 as default };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_static.js
JavaScript
class Foo { static test() { return _class_static_private_field_spec_get(Foo, Foo, _bar); } test() { return _class_static_private_field_spec_get(Foo, Foo, _bar); } } var _bar = { writable: true, value: "foo" }; expect("bar" in Foo).toBe(false); expect(Foo.test()).toBe("foo"); expect(Foo.test()).toBe("foo");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_static_call.js
JavaScript
var Foo = /*#__PURE__*/ function() { "use strict"; function Foo() { _class_call_check(this, Foo); } _create_class(Foo, [ { key: "test", value: function test(x) { return _class_static_private_field_spec_get(Foo, Foo, _foo).call(Foo, x); } } ]); return Foo; }(); var _foo = { writable: true, value: function(x) { return x; } };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_static_export.js
JavaScript
export class MyClass { } var _property = { writable: true, value: value }; class MyClass2 { } var _property1 = { writable: true, value: value }; export { MyClass2 as default };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_static_inherited.js
JavaScript
class Base { static getThis() { return _class_static_private_field_spec_get(this, Base, _foo); } static updateThis(val) { return _class_static_private_field_spec_set(this, Base, _foo, val); } static getClass() { return _class_static_private_field_spec_get(Base, Base, _foo); } static updateClass(val) { return _class_static_private_field_spec_set(Base, Base, _foo, val); } } var _foo = { writable: true, value: 1 }; class Sub1 extends Base { static update(val) { return _class_static_private_field_spec_set(this, Sub1, _foo1, val); } } var _foo1 = { writable: true, value: 2 }; class Sub2 extends Base { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_static_undefined.js
JavaScript
class Foo { static test() { return _class_static_private_field_spec_get(Foo, Foo, _bar); } test() { return _class_static_private_field_spec_get(Foo, Foo, _bar); } } var _bar = { writable: true, value: void 0 };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_call.js
JavaScript
var A = /*#__PURE__*/ function() { "use strict"; function A() { _class_call_check(this, A); } _create_class(A, [ { key: "foo", value: function foo() { return "bar"; } } ]); return A; }(); var _foo = /*#__PURE__*/ new WeakMap(); var B = /*#__PURE__*/ function(A) { "use strict"; _inherits(B, A); function B() { _class_call_check(this, B); var _this; _this = _call_super(this, B, arguments), _class_private_field_init(_this, _foo, { writable: true, value: _get((_assert_this_initialized(_this), _get_prototype_of(B.prototype)), "foo", _this).call(_this) }); return _this; } return B; }(A);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_expression.js
JavaScript
var _bar = /*#__PURE__*/ new WeakMap(); var Foo = /*#__PURE__*/ function(Bar1) { "use strict"; _inherits(Foo, Bar1); function Foo() { _class_call_check(this, Foo); var _this; foo([ _this = _call_super(this, Foo), _class_private_field_init(_this, _bar, { writable: true, value: "foo" }) ][0]); return _this; } return Foo; }(Bar);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_statement.js
JavaScript
var _bar = /*#__PURE__*/ new WeakMap(); var Foo = /*#__PURE__*/ function(Bar1) { "use strict"; _inherits(Foo, Bar1); function Foo() { _class_call_check(this, Foo); var _this; _this = _call_super(this, Foo), _class_private_field_init(_this, _bar, { writable: true, value: "foo" }); return _this; } return Foo; }(Bar);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_update.js
JavaScript
var _foo = /*#__PURE__*/ new WeakMap(); var Foo = /*#__PURE__*/ function() { "use strict"; function Foo() { _class_call_check(this, Foo); _class_private_field_init(this, _foo, { writable: true, value: 0 }); } _create_class(Foo, [ { key: "test", value: function test(other) { _class_private_field_update(this, _foo).value++; ++_class_private_field_update(this, _foo).value; _class_private_field_update(other.obj, _foo).value++; ++_class_private_field_update(other.obj, _foo).value; } } ]); return Foo; }();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_arrow_static_this_without_transform.js
JavaScript
var _this = this; class Foo { static fn = function() { return console.log(_this); }; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_assignment.js
JavaScript
var Foo = /*#__PURE__*/ function() { "use strict"; function Foo() { _class_call_check(this, Foo); _define_property(this, "foo", 0); } _create_class(Foo, [ { key: "test", value: function test(other) { this.foo++; this.foo += 1; this.foo = 2; other.obj.foo++; other.obj.foo += 1; other.obj.foo = 2; } } ]); return Foo; }();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_call.js
JavaScript
var Foo = /*#__PURE__*/ function() { "use strict"; function Foo() { _class_call_check(this, Foo); _define_property(this, "foo", function() { return this; }); } _create_class(Foo, [ { key: "test", value: function test(other) { this.foo(); other.obj.foo(); } } ]); return Foo; }();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_computed.js
JavaScript
var foo = "foo"; var bar = ()=>{}; var four = 4; var _one = one(), _ref = 2 * 4 + 7, _ref1 = 2 * four + 7, _ref2 = 2 * four + seven, _undefined = undefined, _ref3 = void 0, _computed = computed(), _computed1 = computed(), _tmp = "test" + one, _ref4 = /regex/, _foo = foo, _bar = bar, _baz = baz, _ref5 = `template${expression}`; var MyClass = /*#__PURE__*/ function() { "use strict"; function MyClass() { _class_call_check(this, MyClass); _define_property(this, null, "null"); _define_property(this, _undefined, "undefined"); _define_property(this, _ref3, "void 0"); _define_property(this, _ref4, "regex"); _define_property(this, _foo, "foo"); _define_property(this, _bar, "bar"); _define_property(this, _baz, "baz"); _define_property(this, `template`, "template"); _define_property(this, _ref5, "template-with-expression"); } _create_class(MyClass, [ { key: "whatever", get: function() {} }, { key: "whatever", set: function(value) {} }, { key: _computed, get: function() {} }, { key: _computed1, set: function(value) {} }, { key: _tmp, value: function() {} } ], [ { key: 10, value: function() {} } ]); return MyClass; }(); _define_property(MyClass, _one, "test"); _define_property(MyClass, _ref, "247"); _define_property(MyClass, _ref1, "247"); _define_property(MyClass, _ref2, "247");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_computed_without_block.js
JavaScript
var createClass = (k)=>{ var _k = k(); var _class = function _class() { "use strict"; _class_call_check(this, _class); _define_property(this, _k, 2); }; return _class; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_constructor_collision.js
JavaScript
var foo = "bar"; var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); _define_property(this, "bar", foo); var foo1 = "foo"; var _$baz = "baz"; }; _define_property(Foo, "bar", baz);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived.js
JavaScript
var Foo = /*#__PURE__*/ function(Bar1) { "use strict"; _inherits(Foo, Bar1); function Foo() { _class_call_check(this, Foo); var _this; _this = _call_super(this, Foo, arguments), _define_property(_this, "bar", "foo"); return _this; } return Foo; }(Bar);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived_multiple_supers.js
JavaScript
var Foo = /*#__PURE__*/ function(Bar1) { "use strict"; _inherits(Foo, Bar1); function Foo() { _class_call_check(this, Foo); var _this; if (condition) { _this = _call_super(this, Foo), _define_property(_this, "bar", "foo"); } else { _this = _call_super(this, Foo), _define_property(_this, "bar", "foo"); } return _assert_this_initialized(_this); } return Foo; }(Bar);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_extracted_this.js
JavaScript
var foo = "bar"; var Foo = function Foo(foo1) { "use strict"; _class_call_check(this, Foo); _define_property(this, "bar", this); _define_property(this, "baz", foo); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_instance.js
JavaScript
var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); _define_property(this, "bar", "foo"); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_instance_computed.js
JavaScript
function test(x) { var _x = x; var F = function F() { "use strict"; _class_call_check(this, F); _define_property(this, _x, 1); }; x = 'deadbeef'; expect(new F().foo).toBe(1); x = 'wrong'; expect(new F().foo).toBe(1); } test('foo');
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_instance_undefined.js
JavaScript
var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); _define_property(this, "bar", void 0); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_native_classes.js
JavaScript
class Foo { constructor(){ _define_property(this, "bar", "bar"); } } _define_property(Foo, "foo", "foo");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_non_block_arrow_func.js
JavaScript
export default ((param)=>{ var App = /*#__PURE__*/ function() { "use strict"; function App() { _class_call_check(this, App); } _create_class(App, [ { key: "getParam", value: function getParam() { return param; } } ]); return App; }(); _define_property(App, "props", { prop1: 'prop1', prop2: 'prop2' }); return App; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_numeric.js
JavaScript
var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); _define_property(this, 0, "foo"); _define_property(this, 1, "bar"); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_regression_t2983.js
JavaScript
var _class; call((_class = function _class() { "use strict"; _class_call_check(this, _class); }, _define_property(_class, "test", true), _class)); var _class1 = function _class() { "use strict"; _class_call_check(this, _class); }; _define_property(_class1, "test", true); export { _class1 as default };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_regression_t6719.js
JavaScript
function withContext(ComposedComponent) { var _WithContext; return _WithContext = /*#__PURE__*/ function(Component1) { "use strict"; _inherits(WithContext, Component1); function WithContext() { _class_call_check(this, WithContext); return _call_super(this, WithContext, arguments); } return WithContext; }(Component), _define_property(_WithContext, "propTypes", { context: PropTypes.shape({ addCss: PropTypes.func, setTitle: PropTypes.func, setMeta: PropTypes.func }) }), _WithContext; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_regression_t7364.js
JavaScript
class MyClass { constructor(){ var _this = this; _define_property(this, "myAsyncMethod", /*#__PURE__*/ _async_to_generator(function*() { console.log(_this); })); } } (class MyClass2 { constructor(){ var _this = this; _define_property(this, "myAsyncMethod", /*#__PURE__*/ _async_to_generator(function*() { console.log(_this); })); } }); class MyClass3 { constructor(){ var _this = this; _define_property(this, "myAsyncMethod", /*#__PURE__*/ _async_to_generator(function*() { console.log(_this); })); } } export { MyClass3 as default };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_static.js
JavaScript
var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); }; _define_property(Foo, "bar", "foo");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_static_export.js
JavaScript
export var MyClass = function MyClass() { "use strict"; _class_call_check(this, MyClass); }; _define_property(MyClass, "property", value); var MyClass2 = function MyClass2() { "use strict"; _class_call_check(this, MyClass2); }; _define_property(MyClass2, "property", value); export { MyClass2 as default };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_static_infer_name.js
JavaScript
var _Foo; var Foo = (_Foo = function Foo() { "use strict"; _class_call_check(this, Foo); }, _define_property(_Foo, "num", 0), _Foo);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_static_super.js
JavaScript
var A = function A() { "use strict"; _class_call_check(this, A); }; _define_property(A, "prop", 1); var B = /*#__PURE__*/ function(A) { "use strict"; _inherits(B, A); function B() { _class_call_check(this, B); return _call_super(this, B, arguments); } return B; }(A); _define_property(B, "prop", 2); _define_property(B, "propA", _get(_get_prototype_of(B), "prop", B)); _define_property(B, "getPropA", ()=>_get(_get_prototype_of(B), "prop", B));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_static_undefined.js
JavaScript
var Foo = function Foo() { "use strict"; _class_call_check(this, Foo); }; _define_property(Foo, "bar", void 0);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_call.js
JavaScript
var A = /*#__PURE__*/ function() { "use strict"; function A() { _class_call_check(this, A); } _create_class(A, [ { key: "foo", value: function foo() { return "bar"; } } ]); return A; }(); var B = /*#__PURE__*/ function(A) { "use strict"; _inherits(B, A); function B() { _class_call_check(this, B); var _this; _this = _call_super(this, B, arguments), _define_property(_this, "foo", _get((_assert_this_initialized(_this), _get_prototype_of(B.prototype)), "foo", _this).call(_this)); return _this; } return B; }(A);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_expression.js
JavaScript
var Foo = /*#__PURE__*/ function(Bar1) { "use strict"; _inherits(Foo, Bar1); function Foo() { _class_call_check(this, Foo); var _this; foo([ _this = _call_super(this, Foo), _define_property(_this, "bar", "foo") ][0]); return _this; } return Foo; }(Bar);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_statement.js
JavaScript
var Foo = /*#__PURE__*/ function(Bar1) { "use strict"; _inherits(Foo, Bar1); function Foo() { _class_call_check(this, Foo); var _this; _this = _call_super(this, Foo), _define_property(_this, "bar", "foo"); return _this; } return Foo; }(Bar);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_with_collision.js
JavaScript
var A = function A(force1) { "use strict"; _class_call_check(this, A); _define_property(this, "force", force); _define_property(this, "foo", _get(_get_prototype_of(A.prototype), "method", this).call(this)); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_update.js
JavaScript
var Foo = /*#__PURE__*/ function() { "use strict"; function Foo() { _class_call_check(this, Foo); _define_property(this, "foo", 0); } _create_class(Foo, [ { key: "test", value: function test(other) { this.foo++; ++this.foo; other.obj.foo++; ++other.obj.foo; } } ]); return Foo; }();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_6153.js
JavaScript
(function() { class Foo { constructor(){ var _this = this; _define_property(this, "fn", function() { return console.log(_this); }); } } _define_property(Foo, "fn", function() { return console.log(Foo); }); }); (function() { class Bar { constructor(){ var _this = this; _define_property(this, "fn", function() { return console.log(_this); }); } } _define_property(Bar, "fn", function() { return console.log(Bar); }); return Bar; }); (function() { class Baz { constructor(force1){ var _this = this; _define_property(this, "fn", function() { return console.log(_this); }); _define_property(this, "force", force); } } _define_property(Baz, "fn", function() { return console.log(Baz); }); }); var qux = (function() { class Qux { constructor(){ var _this = this; _define_property(this, "fn", function() { return console.log(_this); }); } } _define_property(Qux, "fn", function() { return console.log(Qux); }); }).bind(this);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_7371.js
JavaScript
"use strict"; class C { } class A extends C { constructor(){ super(), _define_property(this, "field", 1); class B extends C { constructor(){ super(); expect(this.field).toBeUndefined(); } } expect(this.field).toBe(1); new B(); } } new A(); class Obj { constructor(){ return {}; } } // ensure superClass is still transformed class SuperClass extends Obj { constructor(){ class B extends (super(), _define_property(this, "field", 1), Obj) { constructor(){ super(); expect(this.field).toBeUndefined(); } } expect(this.field).toBe(1); new B(); } } new SuperClass(); // ensure ComputedKey Method is still transformed class ComputedMethod extends Obj { constructor(){ let _tmp = [ super(), _define_property(this, "field", 1) ][0]; class B extends Obj { [_tmp]() {} constructor(){ super(); expect(this.field).toBeUndefined(); } } expect(this.field).toBe(1); new B(); } } new ComputedMethod(); // ensure ComputedKey Field is still transformed class ComputedField extends Obj { constructor(){ let _ref = [ super(), _define_property(this, "field", 1) ][0]; class B extends Obj { constructor(){ super(), _define_property(this, _ref, 1); expect(this.field).toBeUndefined(); } } expect(this.field).toBe(1); new B(); } } new ComputedField();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_7951.js
JavaScript
export class Foo extends Bar { constructor(...args1){ super(...args1), _define_property(this, "test", args); } } _define_property(Foo, "foo", {});
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_8110.js
JavaScript
const field = Symbol('field'); let _field = field; class A { constructor(){ _define_property(this, _field, 10); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_8882.js
JavaScript
const classes = []; for(let i = 0; i <= 10; ++i){ classes.push(function() { class A { getBar() { return _class_private_field_get(this, _bar); } constructor(){ _define_property(this, i, `computed field ${i}`); _bar.set(this, { writable: true, value: `private field ${i}` }); } } _define_property(A, 'foo', `static field ${i}`); var _bar = new WeakMap(); return A; }()); }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/set_only_getter.js
JavaScript
var _privateField = /*#__PURE__*/ new WeakMap(), _privateFieldValue = /*#__PURE__*/ new WeakMap(); class Cl { get self() { this.counter++; return this; } constructor(){ _class_private_field_init(this, _privateFieldValue, { get: get_privateFieldValue, set: void 0 }); _class_private_field_init(this, _privateField, { writable: true, value: 0 }); _define_property(this, "counter", 0); this.self, _read_only_error("#privateFieldValue"); [_class_private_field_destructure(this.self, _privateFieldValue).value] = [ 1 ]; } } function get_privateFieldValue() { return _class_private_field_get(this, _privateField); } const cl = new Cl();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/set_public_constructor_collision.js
JavaScript
var foo = "bar"; class Foo { constructor(){ this.bar = foo; var foo1 = "foo"; var baz1 = "baz"; } } Foo.bar = baz;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/set_public_fields_computed.js
JavaScript
const foo = "foo"; const bar = ()=>{}; const four = 4; let _one = one(), _ref = 2 * 4 + 7, _ref1 = 2 * four + 7, _ref2 = 2 * four + seven, _undefined = undefined, _ref3 = void 0, _computed = computed(), _computed1 = computed(), _tmp = "test" + one, _ref4 = /regex/, _foo = foo, _bar = bar, _baz = baz, _ref5 = `template${expression}`; class MyClass { get ["whatever"]() {} set ["whatever"](value) {} get [_computed]() {} set [_computed1](value) {} [_tmp]() {} static [10]() {} constructor(){ this[null] = "null"; this[_undefined] = "undefined"; this[_ref3] = "void 0"; this[_ref4] = "regex"; this[_foo] = "foo"; this[_bar] = "bar"; this[_baz] = "baz"; this[`template`] = "template"; this[_ref5] = "template-with-expression"; } } MyClass[_one] = "test"; MyClass[_ref] = "247"; MyClass[_ref1] = "247"; MyClass[_ref2] = "247";
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/set_public_static_undefined.js
JavaScript
class Foo { } Foo.bar = void 0;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/staic_private_destructuring_array_pattern.js
JavaScript
var _a = /*#__PURE__*/ new WeakMap(); class A { foo() { [_class_private_field_destructure(a(), _a).value] = []; } constructor(){ _class_private_field_init(this, _a, { writable: true, value: 123 }); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/static_property_tdz_edgest_case.js
JavaScript
let _x = { x: (_class_name_tdz_error("A"), A) || 0 }.x; let A = function A() { "use strict"; _class_call_check(this, A); }; _define_property(A, _x, void 0);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University