fix corner case in evaluate (#4272)

fixes #4271
This commit is contained in:
Alex Lam S.L
2020-11-10 16:06:13 +00:00
committed by GitHub
parent 41310e6404
commit fba27bfb71
2 changed files with 28 additions and 4 deletions

View File

@@ -3592,10 +3592,7 @@ merge(Compressor.prototype, {
key = key._eval(compressor, ignore_side_effects, cached, depth);
if (key === prop.key) return this;
}
if (prop.value instanceof AST_Function) {
if (typeof Object.prototype[key] == "function") return this;
continue;
}
if (prop.value instanceof AST_Function && typeof Object.prototype[key] == "function") return this;
val[key] = prop.value._eval(compressor, ignore_side_effects, cached, depth);
if (val[key] === prop.value) return this;
}