Add test for _initProto with existing constructor

This commit is contained in:
Nicolò Ribaudo 2022-01-09 00:24:01 +01:00
parent f23bcbc28b
commit faf44db9d9
4 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,12 @@
class A extends B {
constructor() {
if (Math.random() > 0.5) {
super(true);
} else {
super(false);
}
}
@deco
method() {}
}

View File

@ -0,0 +1,20 @@
var _initProto;
class A extends B {
static {
[_initProto] = babelHelpers.applyDecs(this, [[deco, 2, "method"]], []);
}
constructor() {
var _super;
if (Math.random() > 0.5) {
_super = super(true), _initProto(this), _super;
} else {
super(false);
}
}
method() {}
}

View File

@ -0,0 +1,10 @@
class A extends B {
constructor() {
let a = 2;
super(a);
foo();
}
@deco
method() {}
}

View File

@ -0,0 +1,16 @@
var _initProto, _super;
class A extends B {
static {
[_initProto] = babelHelpers.applyDecs(this, [[deco, 2, "method"]], []);
}
constructor() {
let a = 2;
_super = super(a), _initProto(this), _super;
foo();
}
method() {}
}