Fix super method call in private instance method calling overridden method (#9801)

* Fix super method call in private instance method calling overridden method

* Change return value in test fixtures

* Update tests to verify that overridden method is not called
This commit is contained in:
Mattias Buelens
2019-04-01 00:50:29 +02:00
committed by Justin Ridgewell
parent ae9b25ac69
commit 3c11a4a930
13 changed files with 78 additions and 20 deletions

View File

@@ -501,7 +501,9 @@ function replaceThisContext(path, ref, superRef, file, loose) {
file,
getObjectRef() {
state.needsClassRef = true;
return path.node.static ? ref : t.thisExpression();
return path.node.static
? ref
: t.memberExpression(ref, t.identifier("prototype"));
},
});
replacer.replace();