fix corner case in hoist_props (#3869)

fixes #3868
This commit is contained in:
Alex Lam S.L
2020-05-10 10:35:24 +01:00
committed by GitHub
parent 33f3b0c1d9
commit c4c9c6d37d
2 changed files with 29 additions and 1 deletions

View File

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