produce new MemberExpression in a CallExpression super identifier instead of mutating the property
This commit is contained in:
@@ -232,8 +232,8 @@ Class.prototype.replaceInstanceSuperReferences = function (methodNode) {
|
||||
if (!t.isMemberExpression(callee)) return;
|
||||
if (callee.object.name !== "super") return;
|
||||
|
||||
// super.test(); -> ClassName.prototype.MethodName.call(this);
|
||||
callee.property.name = callee.property.name + ".call";
|
||||
// super.test(); -> ClassName.prototype.MethodName.call(this);
|
||||
callee.property = t.memberExpression(callee.property, t.identifier("call"));
|
||||
node.arguments.unshift(t.thisExpression());
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user