Skip to content

Commit

Permalink
chore: update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed Aug 25, 2024
1 parent 4de77fd commit 6a370eb
Show file tree
Hide file tree
Showing 28 changed files with 60 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions crates/swc_bundler/tests/fixture/deno-9591/output/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
function bar(props) {}
class Foo {
constructor(){
super();
_define_property(this, "onBar", ()=>{
super(), _define_property(this, "onBar", ()=>{
bar();
});
bar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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(){
Expand All @@ -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();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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", {});
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export class BadRequestError extends Error {
constructor(message){
super(message);
this.message = message;
super(message), this.message = message;
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 6a370eb

Please # to comment.