diff --git a/src/babel/traversal/index.js b/src/babel/traversal/index.js index ffeebb7b86..dd095707e2 100644 --- a/src/babel/traversal/index.js +++ b/src/babel/traversal/index.js @@ -5,7 +5,7 @@ import * as t from "../types"; export default function traverse(parent, opts, scope, state, parentPath) { if (!parent) return; - if (!opts.noScope && (!scope || !parentPath)) { + if (!opts.noScope && !scope) { if (parent.type !== "Program" && parent.type !== "File") { throw new Error(`Must pass a scope and parentPath unless traversing a Program/File got a ${parent.type} node`); }