public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5801fa3
)
Fix compressing `![foo()];` as a statement
author
Mihai Bazon
<mihai.bazon@gmail.com>
Mon, 23 Mar 2015 21:27:00 +0000
(23:27 +0200)
committer
Mihai Bazon
<mihai.bazon@gmail.com>
Mon, 23 Mar 2015 21:27:00 +0000
(23:27 +0200)
need to check whether the literal has any side effects before replacing that
with `false`.
lib/compress.js
patch
|
blob
|
history
diff --git
a/lib/compress.js
b/lib/compress.js
index
a9e1da3
..
41e4f17
100644
(file)
--- a/
lib/compress.js
+++ b/
lib/compress.js
@@
-2480,7
+2480,7
@@
merge(Compressor.prototype, {
});
function literals_in_boolean_context(self, compressor) {
- if (compressor.option("booleans") && compressor.in_boolean_context()) {
+ if (compressor.option("booleans") && compressor.in_boolean_context()
&& !self.has_side_effects(compressor)
) {
return make_node(AST_True, self);
}
return self;