Ensure constructors use the current super class.

This is an extension of 324a4a1b22.
This commit is contained in:
Brian Donovan
2015-01-08 09:31:18 -08:00
parent 8c478f29bc
commit af1912ab7a
5 changed files with 11 additions and 11 deletions

View File

@@ -1,3 +1,3 @@
if (SUPER_NAME !== null) {
SUPER_NAME.apply(this, arguments);
if (Object.getPrototypeOf(CLASS_NAME) !== null) {
Object.getPrototypeOf(CLASS_NAME).apply(this, arguments);
}

View File

@@ -149,7 +149,7 @@ Class.prototype.buildBody = function () {
if (!this.hasConstructor && superName && !t.isFalsyExpression(superName)) {
constructor.body.body.push(util.template("class-super-constructor-call", {
SUPER_NAME: superName
CLASS_NAME: className
}, true));
}