delegate removal of nodes in traversal to exitNode

This commit is contained in:
Sebastian McKenzie
2015-02-04 08:24:38 +11:00
parent 49847e70af
commit 3b3255a964

View File

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