[Pkg-javascript-commits] [uglifyjs] 175/491: clean up `TreeWalker.pop()` (#2195)

Jonas Smedegaard dr at jones.dk
Wed Feb 14 19:51:33 UTC 2018


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/3.3.10-1
in repository uglifyjs.

commit 6b3aeff1d8975f769f7e251c23405baf3a6f2b5a
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Mon Jul 3 03:23:38 2017 +0800

    clean up `TreeWalker.pop()` (#2195)
    
    Remove superfluous parameter.
---
 lib/ast.js       | 7 +++----
 lib/transform.js | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/ast.js b/lib/ast.js
index 2972b7a..0918574 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 112e5f2..8008e57 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;
         });
     };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list