fix corner case in hoist_props (#5499)

fixes #5498
This commit is contained in:
Alex Lam S.L
2022-06-07 16:29:42 +01:00
committed by GitHub
parent a758b40e3f
commit 123f9cf987
2 changed files with 25 additions and 2 deletions

View File

@@ -8311,8 +8311,10 @@ Compressor.prototype.compress = function(node) {
if (fixed.escaped && fixed.escaped.depth == 1) return;
return right instanceof AST_Object
&& right.properties.length > 0
&& all(right.properties, can_hoist_property)
&& can_drop_symbol(sym, compressor);
&& can_drop_symbol(sym, compressor)
&& all(right.properties, function(prop) {
return can_hoist_property(prop) && prop.key !== "__proto__";
});
}
});