From 6a370eb57238c7739dd1b4eb414832568940d33b Mon Sep 17 00:00:00 2001 From: magic-akari Date: Mon, 26 Aug 2024 00:57:06 +0800 Subject: [PATCH] chore: update test cases --- .../fixture/deno-9591/output/entry.inlined.ts | 3 +-- .../tests/fixture/deno-9591/output/entry.ts | 3 +-- .../deno-9620/case1/output/entry.inlined.ts | 4 +--- .../fixture/deno-9620/case1/output/entry.ts | 4 +--- .../constant_super_field.js | 3 +-- .../issue_2021_1.js | 3 +-- .../es2022_class_properties.rs/issue_308.js | 3 +-- .../private_derived.js | 5 ++-- .../private_derived_multiple_supers.js | 6 ++--- .../private_foobar.js | 5 ++-- .../private_super_call.js | 5 ++-- .../private_super_expression.js | 12 ++++++---- .../private_super_statement.js | 5 ++-- .../public_derived.js | 5 ++-- .../public_derived_multiple_supers.js | 6 ++--- .../public_super_call.js | 5 ++-- .../public_super_expression.js | 6 +++-- .../public_super_statement.js | 5 ++-- .../regression_7371.js | 24 +++++++++++-------- .../regression_7951.js | 3 +-- .../class_fields_use_set/basic/2/output.js | 4 +--- .../class_fields_use_set/basic/3/output.js | 4 +--- .../tests/strip.rs/issue_1472_1_define.js | 4 +--- .../tests/strip.rs/issue_1472_1_no_define.js | 4 +--- .../tests/strip.rs/issue_912.js | 3 +-- .../tests/strip.rs/issue_926.js | 4 +--- .../tests/strip.rs/typescript_002.js | 7 +----- .../tests/pass/deno-001/full/output/entry.js | 7 ++---- 28 files changed, 60 insertions(+), 92 deletions(-) diff --git a/crates/swc_bundler/tests/fixture/deno-9591/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-9591/output/entry.inlined.ts index ee78d0f89d94c..dad9e56a7b28f 100644 --- a/crates/swc_bundler/tests/fixture/deno-9591/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-9591/output/entry.inlined.ts @@ -1847,8 +1847,7 @@ class BufWriterSync extends AbstractBufBase { return writer instanceof BufWriterSync ? writer : new BufWriterSync(writer, size); } constructor(writer, size = 4096){ - super(); - this.writer = writer; + super(), this.writer = writer; if (size <= 0) { size = DEFAULT_BUF_SIZE; } diff --git a/crates/swc_bundler/tests/fixture/deno-9591/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-9591/output/entry.ts index 768e5eaa4a2f6..2a8980821e204 100644 --- a/crates/swc_bundler/tests/fixture/deno-9591/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-9591/output/entry.ts @@ -1857,8 +1857,7 @@ class BufWriterSync extends AbstractBufBase { return writer instanceof BufWriterSync ? writer : new BufWriterSync(writer, size); } constructor(writer, size = DEFAULT_BUF_SIZE){ - super(); - this.writer = writer; + super(), this.writer = writer; if (size <= 0) { size = DEFAULT_BUF_SIZE; } diff --git a/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.inlined.ts b/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.inlined.ts index b862fc24c46a7..d5dcba9e61a36 100644 --- a/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.inlined.ts +++ b/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.inlined.ts @@ -1204,9 +1204,7 @@ class BufferFullError extends Error { partial; name; constructor(partial){ - super("Buffer full"); - this.partial = partial; - this.name = "BufferFullError"; + super("Buffer full"), this.partial = partial, this.name = "BufferFullError"; } } class PartialReadError extends Deno.errors.UnexpectedEof { diff --git a/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.ts b/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.ts index 9a1a8a94aa31e..1266ba12abc03 100644 --- a/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.ts +++ b/crates/swc_bundler/tests/fixture/deno-9620/case1/output/entry.ts @@ -1214,9 +1214,7 @@ class BufferFullError extends Error { partial; name; constructor(partial){ - super("Buffer full"); - this.partial = partial; - this.name = "BufferFullError"; + super("Buffer full"), this.partial = partial, this.name = "BufferFullError"; } } class PartialReadError extends Deno.errors.UnexpectedEof { diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/constant_super_field.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/constant_super_field.js index 550b167096e7d..a6089eaf561bf 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/constant_super_field.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/constant_super_field.js @@ -1,7 +1,6 @@ class A extends B { constructor(...args){ - super(...args); - _define_property(this, "foo", super.bar); + super(...args), _define_property(this, "foo", super.bar); } } _define_property(A, "foo", B.bar); diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_2021_1.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_2021_1.js index 499aa7834ca13..3772945d97f78 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_2021_1.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_2021_1.js @@ -1,6 +1,5 @@ class Item extends Component { constructor(props){ - super(props); - _define_property(this, "input", this.props.item); + super(props), _define_property(this, "input", this.props.item); } } diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_308.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_308.js index c6e479a818d21..6fd2ca6128650 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_308.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/issue_308.js @@ -1,8 +1,7 @@ function bar(props) {} class Foo { constructor(){ - super(); - _define_property(this, "onBar", ()=>{ + super(), _define_property(this, "onBar", ()=>{ bar(); }); bar(); diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived.js index 8e932fa309670..0d15c2818bd8b 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived.js @@ -15,12 +15,11 @@ var Bar = /*#__PURE__*/ function(Foo) { function Bar() { _class_call_check(this, Bar); var _this; - _this = _super.apply(this, arguments); - _class_private_field_init(_assert_this_initialized(_this), _prop1, { + _this = _super.apply(this, arguments), _class_private_field_init(_assert_this_initialized(_this), _prop1, { writable: true, value: "bar" }); - return _this; + return _possible_constructor_return(_this); } return Bar; }(Foo); diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived_multiple_supers.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived_multiple_supers.js index 827867e2fa60a..e77dd69ffab90 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived_multiple_supers.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived_multiple_supers.js @@ -7,14 +7,12 @@ var Foo = /*#__PURE__*/ function(Bar1) { _class_call_check(this, Foo); var _this; if (condition) { - _this = _super.call(this); - _class_private_field_init(_assert_this_initialized(_this), _bar, { + _this = _super.call(this), _class_private_field_init(_assert_this_initialized(_this), _bar, { writable: true, value: "foo" }); } else { - _this = _super.call(this); - _class_private_field_init(_assert_this_initialized(_this), _bar, { + _this = _super.call(this), _class_private_field_init(_assert_this_initialized(_this), _bar, { writable: true, value: "foo" }); diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_foobar.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_foobar.js index 46a21b5913004..15d164feb7f00 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_foobar.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_foobar.js @@ -6,14 +6,13 @@ var Child = /*#__PURE__*/ function(Parent1) { function Child() { _class_call_check(this, Child); var _this; - _this = _super.call(this); - _class_private_field_init(_assert_this_initialized(_this), _scopedFunctionWithThis, { + _this = _super.call(this), _class_private_field_init(_assert_this_initialized(_this), _scopedFunctionWithThis, { writable: true, value: ()=>{ _this.name = {}; } }); - return _this; + return _possible_constructor_return(_this); } return Child; }(Parent); diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_call.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_call.js index 022b2c04292ee..1e4086035d480 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_call.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_call.js @@ -21,12 +21,11 @@ var B = /*#__PURE__*/ function(A) { function B() { _class_call_check(this, B); var _this; - _this = _super.apply(this, arguments); - _class_private_field_init(_assert_this_initialized(_this), _foo, { + _this = _super.apply(this, arguments), _class_private_field_init(_assert_this_initialized(_this), _foo, { writable: true, value: _get((_assert_this_initialized(_this), _get_prototype_of(B.prototype)), "foo", _this).call(_this) }); - return _this; + return _possible_constructor_return(_this); } return B; }(A); diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_expression.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_expression.js index 55208bae871b0..451171b585dd0 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_expression.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_expression.js @@ -6,11 +6,13 @@ var Foo = /*#__PURE__*/ function(Bar1) { function Foo() { _class_call_check(this, Foo); var _this; - var _temp; - foo((_temp = _this = _super.call(this), _class_private_field_init(_assert_this_initialized(_this), _bar, { - writable: true, - value: "foo" - }), _temp)); + foo([ + _this = _super.call(this), + _class_private_field_init(_this, _bar, { + writable: true, + value: "foo" + }) + ][0]); return _possible_constructor_return(_this); } return Foo; diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_statement.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_statement.js index 67c3e508dab00..5f1bf4c6e4a77 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_statement.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_statement.js @@ -6,12 +6,11 @@ var Foo = /*#__PURE__*/ function(Bar1) { function Foo() { _class_call_check(this, Foo); var _this; - _this = _super.call(this); - _class_private_field_init(_assert_this_initialized(_this), _bar, { + _this = _super.call(this), _class_private_field_init(_assert_this_initialized(_this), _bar, { writable: true, value: "foo" }); - return _this; + return _possible_constructor_return(_this); } return Foo; }(Bar); diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived.js index c08fe418c457a..71a547e66c6a1 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived.js @@ -5,9 +5,8 @@ var Foo = /*#__PURE__*/ function(Bar1) { function Foo() { _class_call_check(this, Foo); var _this; - _this = _super.apply(this, arguments); - _define_property(_assert_this_initialized(_this), "bar", "foo"); - return _this; + _this = _super.apply(this, arguments), _define_property(_assert_this_initialized(_this), "bar", "foo"); + return _possible_constructor_return(_this); } return Foo; }(Bar); diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived_multiple_supers.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived_multiple_supers.js index cc78776002cbe..6fe278cc2f8fd 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived_multiple_supers.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived_multiple_supers.js @@ -6,11 +6,9 @@ var Foo = /*#__PURE__*/ function(Bar1) { _class_call_check(this, Foo); var _this; if (condition) { - _this = _super.call(this); - _define_property(_assert_this_initialized(_this), "bar", "foo"); + _this = _super.call(this), _define_property(_assert_this_initialized(_this), "bar", "foo"); } else { - _this = _super.call(this); - _define_property(_assert_this_initialized(_this), "bar", "foo"); + _this = _super.call(this), _define_property(_assert_this_initialized(_this), "bar", "foo"); } return _possible_constructor_return(_this); } diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_call.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_call.js index dbedf7d81b152..7b89c40929569 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_call.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_call.js @@ -20,9 +20,8 @@ var B = /*#__PURE__*/ function(A) { function B() { _class_call_check(this, B); var _this; - _this = _super.apply(this, arguments); - _define_property(_assert_this_initialized(_this), "foo", _get((_assert_this_initialized(_this), _get_prototype_of(B.prototype)), "foo", _this).call(_this)); - return _this; + _this = _super.apply(this, arguments), _define_property(_assert_this_initialized(_this), "foo", _get((_assert_this_initialized(_this), _get_prototype_of(B.prototype)), "foo", _this).call(_this)); + return _possible_constructor_return(_this); } return B; }(A); diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_expression.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_expression.js index 26fe6286a44a8..3531e09c1bc62 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_expression.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_expression.js @@ -5,8 +5,10 @@ var Foo = /*#__PURE__*/ function(Bar1) { function Foo() { _class_call_check(this, Foo); var _this; - var _temp; - foo((_temp = _this = _super.call(this), _define_property(_assert_this_initialized(_this), "bar", "foo"), _temp)); + foo([ + _this = _super.call(this), + _define_property(_this, "bar", "foo") + ][0]); return _possible_constructor_return(_this); } return Foo; diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_statement.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_statement.js index c7a6f0f1f95c1..f2172c2fa6e3a 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_statement.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_statement.js @@ -5,9 +5,8 @@ var Foo = /*#__PURE__*/ function(Bar1) { function Foo() { _class_call_check(this, Foo); var _this; - _this = _super.call(this); - _define_property(_assert_this_initialized(_this), "bar", "foo"); - return _this; + _this = _super.call(this), _define_property(_assert_this_initialized(_this), "bar", "foo"); + return _possible_constructor_return(_this); } return Foo; }(Bar); diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_7371.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_7371.js index ecc7dc7e067f5..c7ab7d3a0c203 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_7371.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_7371.js @@ -3,8 +3,7 @@ class C { } class A extends C { constructor(){ - super(); - _define_property(this, "field", 1); + super(), _define_property(this, "field", 1); class B extends C { constructor(){ super(); @@ -24,8 +23,10 @@ class Obj { // ensure superClass is still transformed class SuperClass extends Obj { constructor(){ - var _temp; - class B extends (_temp = super(), _define_property(this, "field", 1), _temp, Obj) { + class B extends ([ + super(), + _define_property(this, "field", 1) + ][0], Obj) { constructor(){ super(); expect(this.field).toBeUndefined(); @@ -39,8 +40,10 @@ new SuperClass(); // ensure ComputedKey Method is still transformed class ComputedMethod extends Obj { constructor(){ - var _temp; - let _tmp = (_temp = super(), _define_property(this, "field", 1), _temp); + let _tmp = [ + super(), + _define_property(this, "field", 1) + ][0]; class B extends Obj { [_tmp]() {} constructor(){ @@ -56,12 +59,13 @@ new ComputedMethod(); // ensure ComputedKey Field is still transformed class ComputedField extends Obj { constructor(){ - var _temp; - let _ref = (_temp = super(), _define_property(this, "field", 1), _temp); + let _ref = [ + super(), + _define_property(this, "field", 1) + ][0]; class B extends Obj { constructor(){ - super(); - _define_property(this, _ref, 1); + super(), _define_property(this, _ref, 1); expect(this.field).toBeUndefined(); } } diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_7951.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_7951.js index 635927ad917ce..c4fff50782345 100644 --- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_7951.js +++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/regression_7951.js @@ -1,7 +1,6 @@ export class Foo extends Bar { constructor(...args1){ - super(...args1); - _define_property(this, "test", args); + super(...args1), _define_property(this, "test", args); } } _define_property(Foo, "foo", {}); diff --git a/crates/swc_ecma_transforms_compat/tests/class_fields_use_set/basic/2/output.js b/crates/swc_ecma_transforms_compat/tests/class_fields_use_set/basic/2/output.js index 320ff9a0f84b0..3e9fb287a1e14 100644 --- a/crates/swc_ecma_transforms_compat/tests/class_fields_use_set/basic/2/output.js +++ b/crates/swc_ecma_transforms_compat/tests/class_fields_use_set/basic/2/output.js @@ -5,8 +5,6 @@ class Foo extends Bar { } static #d = 4; constructor(...args){ - super(...args); - this.a = 1; - this.#b = 2; + super(...args), this.a = 1, this.#b = 2; } } diff --git a/crates/swc_ecma_transforms_compat/tests/class_fields_use_set/basic/3/output.js b/crates/swc_ecma_transforms_compat/tests/class_fields_use_set/basic/3/output.js index 42f2cbb2193a6..ee9b3319a4465 100644 --- a/crates/swc_ecma_transforms_compat/tests/class_fields_use_set/basic/3/output.js +++ b/crates/swc_ecma_transforms_compat/tests/class_fields_use_set/basic/3/output.js @@ -1,9 +1,7 @@ class Foo extends Bar { #b; constructor(){ - super(); - this.a = 1; - this.#b = 2; + super(), this.a = 1, this.#b = 2; console.log("constructor"); } static{ diff --git a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_1472_1_define.js b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_1472_1_define.js index 59580ac458010..f5ebb33823264 100644 --- a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_1472_1_define.js +++ b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_1472_1_define.js @@ -2,8 +2,6 @@ class A extends Object { b; a; constructor(b = 2){ - super(); - this.b = b; - this.a = 1; + super(), this.b = b, this.a = 1; } } diff --git a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_1472_1_no_define.js b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_1472_1_no_define.js index 4e9dd851fc958..ee139022d8b01 100644 --- a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_1472_1_no_define.js +++ b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_1472_1_no_define.js @@ -1,7 +1,5 @@ class A extends Object { constructor(b = 2){ - super(); - this.b = b; - this.a = 1; + super(), this.b = b, this.a = 1; } } diff --git a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_912.js b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_912.js index c6e1836a0d8e7..e1cee62b2e22c 100644 --- a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_912.js +++ b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_912.js @@ -1,6 +1,5 @@ export class BadRequestError extends Error { constructor(message){ - super(message); - this.message = message; + super(message), this.message = message; } } diff --git a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_926.js b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_926.js index 97dba50675d9f..93f7e3bdbd154 100644 --- a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_926.js +++ b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_926.js @@ -1,7 +1,5 @@ class A extends Object { constructor(a, b){ - super(); - this.a = a; - this.b = b; + super(), this.a = a, this.b = b; } } diff --git a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/typescript_002.js b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/typescript_002.js index 2d76fed46cae3..7bb87aca68487 100644 --- a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/typescript_002.js +++ b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/typescript_002.js @@ -1,11 +1,6 @@ class A extends B { constructor(a, c, d = 1){ - super(); - this.a = a; - this.c = c; - this.d = d; - this.foo = 'foo'; - this.b = this.a; + super(), this.a = a, this.c = c, this.d = d, this.foo = 'foo', this.b = this.a; this.foo.subscribe(); } } diff --git a/crates/swc_node_bundler/tests/pass/deno-001/full/output/entry.js b/crates/swc_node_bundler/tests/pass/deno-001/full/output/entry.js index a3e6e347535a4..f8c6eb2f9b46d 100644 --- a/crates/swc_node_bundler/tests/pass/deno-001/full/output/entry.js +++ b/crates/swc_node_bundler/tests/pass/deno-001/full/output/entry.js @@ -29,9 +29,7 @@ class BufferFullError extends Error { partial; name; constructor(partial){ - super("Buffer full"); - this.partial = partial; - this.name = "BufferFullError"; + super("Buffer full"), this.partial = partial, this.name = "BufferFullError"; } } class PartialReadError extends Deno.errors.UnexpectedEof { @@ -243,8 +241,7 @@ class BufWriter extends AbstractBufBase { return writer instanceof BufWriter ? writer : new BufWriter(writer, size); } constructor(writer, size = DEFAULT_BUF_SIZE){ - super(); - this.writer = writer; + super(), this.writer = writer; if (size <= 0) size = DEFAULT_BUF_SIZE; this.buf = new Uint8Array(size); }