public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a9fa178
)
Add simple optimization for empty-string concats.
author
Richard van Velzen
<rvanvelzen@expert-shops.com>
Mon, 12 Nov 2012 14:41:03 +0000
(15:41 +0100)
committer
Richard van Velzen
<rvanvelzen@expert-shops.com>
Mon, 12 Nov 2012 14:41:03 +0000
(15:41 +0100)
ref. #43
lib/compress.js
patch
|
blob
|
history
diff --git
a/lib/compress.js
b/lib/compress.js
index
a4a53f5
..
fce0757
100644
(file)
--- a/
lib/compress.js
+++ b/
lib/compress.js
@@
-1642,6
+1642,11
@@
merge(Compressor.prototype, {
case "<=": reverse(">="); break;
}
}
+ if (self.operator == "+" && self.right instanceof AST_String
+ && self.right.getValue() === "" && self.left instanceof AST_Binary
+ && self.left.operator == "+" && self.left.left instanceof AST_String) {
+ return self.left;
+ }
return self;
});