remove parentPath existence check

This commit is contained in:
Sebastian McKenzie 2015-04-03 06:48:46 +11:00
parent bf811ea34a
commit c07704cc80

View File

@ -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`);
}