Transform can be simplified when clone is not done. (#2621)

This commit is contained in:
Ondřej Španěl
2017-12-19 10:56:16 +01:00
committed by Alex Lam S.L
parent 032f096b7f
commit 01057cf76d

View File

@@ -60,12 +60,9 @@ TreeTransformer.prototype = new TreeWalker;
tw.push(this);
if (tw.before) x = tw.before(this, descend, in_list);
if (x === undefined) {
if (!tw.after) {
x = this;
descend(x, tw);
} else {
tw.stack[tw.stack.length - 1] = x = this;
descend(x, tw);
x = this;
descend(x, tw);
if (tw.after) {
y = tw.after(x, in_list);
if (y !== undefined) x = y;
}