diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-12-05 13:14:49 +0200 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-12-05 13:14:49 +0200 |
commit | 16430acc1f677c81b2c715b3576f8079c6e1e2df (patch) | |
tree | d11946f19663ed378f3cc02fd51213248bd481ef | |
parent | 320c110b331be9c6cb20f4db1d63aaaa98eef739 (diff) | |
download | tracifyjs-16430acc1f677c81b2c715b3576f8079c6e1e2df.tar.gz tracifyjs-16430acc1f677c81b2c715b3576f8079c6e1e2df.zip |
small improvement on merging assignments into hoisted vars
-rw-r--r-- | lib/compress.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js index 2355c5e6..9387a821 100644 --- 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, { |