ignore unknown nodes in traversal
This commit is contained in:
parent
f1183505b1
commit
2b82f2bcc2
@ -18,7 +18,7 @@ function traverse(parent, callbacks, opts) {
|
||||
|
||||
// unknown node type to traverse
|
||||
var keys = t.VISITOR_KEYS[parent.type];
|
||||
if (!keys) throw new Error("unknown node " + parent.type);
|
||||
if (!keys) return;
|
||||
|
||||
opts = opts || {};
|
||||
if (_.isArray(opts)) opts = { blacklist: opts };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user