Fix super nested class bugs (#7691)

* Properly traverse nested class for supers

* Add object nested in class cases

* Add object nested object cases

* Test class properties

* Undo changes to lerna.json

* Add tests arournd prefix/postfix super increment

* tmp

* Use sets
This commit is contained in:
Justin Ridgewell
2018-04-12 13:02:26 -04:00
committed by GitHub
parent af3d6526e7
commit ecbf0dd53c
37 changed files with 907 additions and 169 deletions

View File

@@ -57,7 +57,7 @@ export default function transformClass(
instancePropRefs: {},
staticPropBody: [],
body: [],
bareSupers: [],
bareSupers: new Set(),
superThises: [],
pushedConstructor: false,
pushedInherits: false,
@@ -388,7 +388,7 @@ export default function transformClass(
path.traverse(findThisesVisitor);
let guaranteedSuperBeforeFinish = !!classState.bareSupers.length;
let guaranteedSuperBeforeFinish = !!classState.bareSupers.size;
const superRef = classState.superName || t.identifier("Function");
let thisRef = function() {