fix unsafe evaluate of AST_Array (#2825)

fixes #2822
This commit is contained in:
Alex Lam S.L
2018-01-21 01:39:44 +08:00
committed by GitHub
parent 069df27bf1
commit e2dc9cf091
2 changed files with 18 additions and 1 deletions

View File

@@ -2240,7 +2240,10 @@ merge(Compressor.prototype, {
var elements = [];
for (var i = 0, len = this.elements.length; i < len; i++) {
var element = this.elements[i];
if (element instanceof AST_Function) continue;
if (element instanceof AST_Function) {
elements.push(element);
continue;
}
var value = element._eval(compressor, depth);
if (element === value) return this;
elements.push(value);