fix corner case in hoist_props (#3872)

fixes #3871
This commit is contained in:
Alex Lam S.L
2020-05-10 15:23:09 +01:00
committed by GitHub
parent f9806b43c3
commit 63adfb1590
3 changed files with 39 additions and 2 deletions

View File

@@ -4931,7 +4931,11 @@ merge(Compressor.prototype, {
if (def.single_use) return;
if (top_retain(def)) return;
if (sym.fixed_value() !== right) return;
return right instanceof AST_Object && right.properties.length > 0;
return right instanceof AST_Object
&& right.properties.length > 0
&& all(right.properties, function(prop) {
return prop instanceof AST_ObjectKeyVal;
});
}
});