workaround pure_getters=true when dropping unused assignments (#2939)
fixes #2938
This commit is contained in:
@@ -3028,9 +3028,11 @@ merge(Compressor.prototype, {
|
||||
} else if (node instanceof AST_Unary && node.write_only) {
|
||||
sym = node.expression;
|
||||
}
|
||||
while (sym instanceof AST_PropAccess && !sym.expression.may_throw_on_access(compressor)) {
|
||||
if (sym instanceof AST_Sub) props.unshift(sym.property);
|
||||
sym = sym.expression;
|
||||
if (/strict/.test(compressor.option("pure_getters"))) {
|
||||
while (sym instanceof AST_PropAccess && !sym.expression.may_throw_on_access(compressor)) {
|
||||
if (sym instanceof AST_Sub) props.unshift(sym.property);
|
||||
sym = sym.expression;
|
||||
}
|
||||
}
|
||||
return sym;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user