[Pkg-javascript-commits] [uglifyjs] 98/491: clean up `lib/scope.js` (#2003)
Jonas Smedegaard
dr at jones.dk
Wed Feb 14 19:51:25 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 c70fb6038448cf072cfa96cee78eaa55aa99c0fa
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date: Fri May 26 03:58:35 2017 +0800
clean up `lib/scope.js` (#2003)
fixes #2004
---
lib/scope.js | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/lib/scope.js b/lib/scope.js
index 14ffb46..8bc9607 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -183,16 +183,8 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
self.walk(tw);
// pass 2: find back references and eval
- var func = null;
- var globals = self.globals = new Dictionary();
+ self.globals = new Dictionary();
var tw = new TreeWalker(function(node, descend){
- if (node instanceof AST_Lambda) {
- var prev_func = func;
- func = node;
- descend();
- func = prev_func;
- return true;
- }
if (node instanceof AST_LoopControl && node.label) {
node.label.thedef.references.push(node);
return true;
@@ -361,9 +353,7 @@ AST_Symbol.DEFMETHOD("unmangleable", function(options){
});
// labels are always mangleable
-AST_Label.DEFMETHOD("unmangleable", function(){
- return false;
-});
+AST_Label.DEFMETHOD("unmangleable", return_false);
AST_Symbol.DEFMETHOD("unreferenced", function(){
return this.definition().references.length == 0
@@ -374,13 +364,9 @@ AST_Symbol.DEFMETHOD("undeclared", function(){
return this.definition().undeclared;
});
-AST_LabelRef.DEFMETHOD("undeclared", function(){
- return false;
-});
+AST_LabelRef.DEFMETHOD("undeclared", return_false);
-AST_Label.DEFMETHOD("undeclared", function(){
- return false;
-});
+AST_Label.DEFMETHOD("undeclared", return_false);
AST_Symbol.DEFMETHOD("definition", function(){
return this.thedef;
--
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