fix corner case in collapse_vars (#4915)

fixes #4914
This commit is contained in:
Alex Lam S.L
2021-05-07 18:14:59 +01:00
committed by GitHub
parent 19d232badb
commit ac1f7d689b
2 changed files with 21 additions and 0 deletions

View File

@@ -1483,6 +1483,7 @@ merge(Compressor.prototype, {
function is_lhs_read_only(lhs, compressor) {
if (lhs instanceof AST_ObjectIdentity) return true;
if (lhs instanceof AST_PropAccess) {
if (lhs.property == "__proto__") return true;
lhs = lhs.expression;
if (lhs instanceof AST_SymbolRef) {
if (lhs.is_immutable()) return false;