use scope paths hub instead of manually passing the hub to the scope

This commit is contained in:
Sebastian McKenzie 2015-06-07 23:37:33 +01:00
parent 60340244b1
commit 66599c3779
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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)) {