delegate removal of nodes in traversal to exitNode
This commit is contained in:
@@ -76,11 +76,6 @@ TraversalContext.prototype.enterNode = function (obj, key, node, enter, parent,
|
||||
}
|
||||
}
|
||||
|
||||
if (this.shouldRemove) {
|
||||
obj[key] = null;
|
||||
this.shouldFlatten = true;
|
||||
}
|
||||
|
||||
return node;
|
||||
};
|
||||
|
||||
@@ -97,6 +92,11 @@ TraversalContext.prototype.exitNode = function (obj, key, node, exit, parent, sc
|
||||
}
|
||||
}
|
||||
|
||||
if (this.shouldRemove) {
|
||||
obj[key] = null;
|
||||
this.shouldFlatten = true;
|
||||
}
|
||||
|
||||
return node;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user