public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
320c110
)
small improvement on merging assignments into hoisted vars
author
Mihai Bazon
<mihai@bazon.net>
Wed, 5 Dec 2012 11:14:49 +0000
(13:14 +0200)
committer
Mihai Bazon
<mihai@bazon.net>
Wed, 5 Dec 2012 11:14:49 +0000
(13:14 +0200)
lib/compress.js
patch
|
blob
|
history
diff --git
a/lib/compress.js
b/lib/compress.js
index
2355c5e
..
9387a82
100644
(file)
--- a/
lib/compress.js
+++ b/
lib/compress.js
@@
-1152,6
+1152,15
@@
merge(Compressor.prototype, {
continue;
}
}
+ if (self.body[i] instanceof AST_EmptyStatement) {
+ self.body.splice(i, 1);
+ continue;
+ }
+ if (self.body[i] instanceof AST_BlockStatement) {
+ var tmp = [ i, 1 ].concat(self.body[i].body);
+ self.body.splice.apply(self.body, tmp);
+ continue;
+ }
break;
}
defs = make_node(AST_Var, self, {