diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-09-17 12:03:02 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-09-17 12:03:02 +0300 |
commit | 14481de0e9141eff41877f56876f7e6a78c3d059 (patch) | |
tree | 75cc59cb592f23c8c979e80354b35fb7330ea6b6 | |
parent | 07f1d56f69a5190d33400d4e5d4032edcaf016ff (diff) | |
download | tracifyjs-14481de0e9141eff41877f56876f7e6a78c3d059.tar.gz tracifyjs-14481de0e9141eff41877f56876f7e6a78c3d059.zip |
empty block to empty statement: {} ==> ;
-rw-r--r-- | lib/compress.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js index ddb4437b..7b865fdd 100644 --- 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; }); |