inline back the super constructor call helper - fixes #684
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
(function (instance, Constructor) {
|
||||
if (Object.getPrototypeOf(Constructor) !== null) {
|
||||
Object.getPrototypeOf(Constructor).apply(instance, arguments);
|
||||
}
|
||||
});
|
||||
if (Object.getPrototypeOf(CLASS_NAME) !== null) {
|
||||
Object.getPrototypeOf(CLASS_NAME).apply(instance, arguments);
|
||||
}
|
||||
|
||||
@@ -169,19 +169,11 @@ Class.prototype.buildBody = function () {
|
||||
// we have no constructor, we have a super, and the super doesn't appear to be falsy
|
||||
if (!this.hasConstructor && superName && !t.isFalsyExpression(superName)) {
|
||||
var helperName = "class-super-constructor-call";
|
||||
|
||||
if (this.isLoose) {
|
||||
constructor.body.body.push(util.template(helperName + "-loose", {
|
||||
CLASS_NAME: className,
|
||||
SUPER_NAME: this.superName
|
||||
}, true));
|
||||
} else {
|
||||
constructor.body.body.push(
|
||||
t.expressionStatement(
|
||||
t.callExpression(this.file.addHelper(helperName), [t.thisExpression(), className])
|
||||
)
|
||||
);
|
||||
}
|
||||
if (this.isLoose) helperName += "-loose"
|
||||
constructor.body.body.push(util.template(helperName, {
|
||||
CLASS_NAME: className,
|
||||
SUPER_NAME: this.superName
|
||||
}, true));
|
||||
}
|
||||
|
||||
var instanceProps;
|
||||
|
||||
Reference in New Issue
Block a user