From 9e61a307d40451940c2a5c425b8d7b480459d001 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 14 Mar 2015 03:34:02 +1100 Subject: [PATCH] fix scope traversal --- src/babel/traversal/scope.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/babel/traversal/scope.js b/src/babel/traversal/scope.js index c653187a42..fc9fd8dfcb 100644 --- a/src/babel/traversal/scope.js +++ b/src/babel/traversal/scope.js @@ -440,13 +440,13 @@ export default class Scope { for (let i = 0; i < params.length; i++) { this.registerBinding("param", params[i]); } - path.get("body").traverse(blockVariableVisitor, this); + this.traverse(path.get("body").node, blockVariableVisitor, this); } // Program, BlockStatement, Function - let variables if (path.isBlockStatement() || path.isProgram()) { - path.traverse(blockVariableVisitor, this); + this.traverse(path.node, blockVariableVisitor, this); } // CatchClause - param @@ -464,7 +464,7 @@ export default class Scope { // Program, Function - var variables if (path.isProgram() || path.isFunction()) { - path.traverse(functionVariableVisitor, { + this.traverse(path.node, functionVariableVisitor, { blockId: path.get("id").node, scope: this }); @@ -473,7 +473,7 @@ export default class Scope { // Program if (path.isProgram()) { - path.traverse(programReferenceVisitor, this); + this.traverse(path.node, programReferenceVisitor, this); } }