diff --git a/src/babel/traversal/path/index.js b/src/babel/traversal/path/index.js index f725b5f0ba..beb87d931c 100644 --- a/src/babel/traversal/path/index.js +++ b/src/babel/traversal/path/index.js @@ -52,7 +52,7 @@ export default class NodePath { // we're entering a new scope so let's construct it! if (this.isScope()) { - ourScope = new Scope(this, scope, this.hub); + ourScope = new Scope(this, scope); } return ourScope; diff --git a/src/babel/traversal/scope/index.js b/src/babel/traversal/scope/index.js index 6ee4e087df..486aa952b5 100644 --- a/src/babel/traversal/scope/index.js +++ b/src/babel/traversal/scope/index.js @@ -140,7 +140,7 @@ export default class Scope { * within. */ - constructor(path: NodePath, parent?: Scope, hub?: Hub) { + constructor(path: NodePath, parent?: Scope) { if (parent && parent.block === path.node) { return parent; } @@ -153,7 +153,7 @@ export default class Scope { } this.parent = parent; - this.hub = parent ? parent.hub : hub; + this.hub = path.hub; this.parentBlock = path.parent; this.block = path.node; @@ -407,7 +407,7 @@ export default class Scope { if (t.isIdentifier(node)) { var binding = this.getBinding(node.name); - if (binding && binding.constant && binding.path.isTypeAnnotationGeneric("Array")) return node; + if (binding && binding.constant && binding.path.isTypeAnnotation("Array")) return node; } if (t.isArrayExpression(node)) {