public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07f1d56
)
empty block to empty statement: {} ==> ;
author
Mihai Bazon
<mihai@bazon.net>
Mon, 17 Sep 2012 09:03:02 +0000
(12:03 +0300)
committer
Mihai Bazon
<mihai@bazon.net>
Mon, 17 Sep 2012 09:03:02 +0000
(12:03 +0300)
lib/compress.js
patch
|
blob
|
history
diff --git
a/lib/compress.js
b/lib/compress.js
index
ddb4437
..
7b865fd
100644
(file)
--- a/
lib/compress.js
+++ b/
lib/compress.js
@@
-759,8
+759,10
@@
function Compressor(options, false_by_default) {
});
AST_BlockStatement.DEFMETHOD("optimize", function(compressor){
- if (this.body.length == 1)
- return this.body[0];
+ switch (this.body.length) {
+ case 1: return this.body[0];
+ case 0: return make_node(AST_EmptyStatement, this);
+ }
return this;
});