From 66599c3779639ca05f8bd4a66c28ffbcbf4ab6da Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 7 Jun 2015 23:37:33 +0100 Subject: [PATCH] use scope paths hub instead of manually passing the hub to the scope --- src/babel/traversal/path/index.js | 2 +- src/babel/traversal/scope/index.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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)) {