ignore unknown nodes in traversal
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user