create and use a inheritsLoose helper

This commit is contained in:
Henry Zhu
2017-06-19 11:58:49 -04:00
parent cdca54aed3
commit 8a4ab088e4
8 changed files with 20 additions and 10 deletions

View File

@@ -563,7 +563,7 @@ export default class ClassTransformer {
// any properties can be assigned to the prototype.
this.pushedInherits = true;
this.body.unshift(t.expressionStatement(t.callExpression(
this.file.addHelper("inherits"),
this.isLoose ? this.file.addHelper("inheritsLoose") : this.file.addHelper("inherits"),
[this.classRef, this.superName]
)));
}