diff --git a/packages/babel-core/test/fixtures/plugins/regression-2772/exec.js b/packages/babel-core/test/fixtures/plugins/regression-2772/exec.js index 90abd66730..b38b6197d9 100644 --- a/packages/babel-core/test/fixtures/plugins/regression-2772/exec.js +++ b/packages/babel-core/test/fixtures/plugins/regression-2772/exec.js @@ -1,7 +1,8 @@ var code = multiline([ "(function() {", + " var bar = 'lol';", " function foo(b){", - ' b === "lol";', + " b === bar;", " foo(b);", " }", "})();", diff --git a/packages/babel-traverse/src/path/introspection.js b/packages/babel-traverse/src/path/introspection.js index 1163642d0e..cda82f81cc 100644 --- a/packages/babel-traverse/src/path/introspection.js +++ b/packages/babel-traverse/src/path/introspection.js @@ -313,7 +313,7 @@ export function _guessExecutionStatusRelativeToDifferentFunctions(targetFuncPare for (let path of referencePaths) { // if a reference is a child of the function we're checking against then we can // safelty ignore it - let childOfFunction = !!path.find(path => path === targetFuncPath); + let childOfFunction = !!path.find(path => path.node === targetFuncPath.node); if (childOfFunction) continue; let status = this._guessExecutionStatusRelativeTo(path);