fix corner case in AST_For.init (#1652)

Enforce `null` as value for empty initialisation blocks.

fixes #1648
This commit is contained in:
Alex Lam S.L
2017-03-24 19:31:17 +08:00
committed by GitHub
parent 0432a7abb9
commit ac51d4c5a0
3 changed files with 20 additions and 1 deletions

View File

@@ -2327,6 +2327,7 @@ merge(Compressor.prototype, {
};
OPT(AST_For, function(self, compressor){
if (is_empty(self.init)) self.init = null;
if (!compressor.option("loops")) return self;
if (self.condition) {
var cond = self.condition.evaluate(compressor);