aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-07-03 03:23:38 +0800
committerGitHub <noreply@github.com>2017-07-03 03:23:38 +0800
commit6b3aeff1d8975f769f7e251c23405baf3a6f2b5a (patch)
treec4b0441d4a00c22a33116c8bfab4dfc6c0b4ca43
parent20e4f8277fc69b275600770c5d41fa1b75b9984f (diff)
downloadtracifyjs-6b3aeff1d8975f769f7e251c23405baf3a6f2b5a.tar.gz
tracifyjs-6b3aeff1d8975f769f7e251c23405baf3a6f2b5a.zip
clean up `TreeWalker.pop()` (#2195)
Remove superfluous parameter.
-rw-r--r--lib/ast.js7
-rw-r--r--lib/transform.js2
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/ast.js b/lib/ast.js
index 2972b7aa..0918574d 100644
--- a/lib/ast.js
+++ b/lib/ast.js
@@ -859,7 +859,7 @@ TreeWalker.prototype = {
if (!ret && descend) {
descend.call(node);
}
- this.pop(node);
+ this.pop();
return ret;
},
parent: function(n) {
@@ -873,9 +873,8 @@ TreeWalker.prototype = {
}
this.stack.push(node);
},
- pop: function(node) {
- this.stack.pop();
- if (node instanceof AST_Lambda) {
+ pop: function() {
+ if (this.stack.pop() instanceof AST_Lambda) {
this.directives = Object.getPrototypeOf(this.directives);
}
},
diff --git a/lib/transform.js b/lib/transform.js
index 112e5f28..8008e571 100644
--- a/lib/transform.js
+++ b/lib/transform.js
@@ -70,7 +70,7 @@ TreeTransformer.prototype = new TreeWalker;
if (y !== undefined) x = y;
}
}
- tw.pop(this);
+ tw.pop();
return x;
});
};