fix cascade on anonymous function reference (#1693)

Unlike normal variables and even function definitions, these cannot be reassigned, even though assignment expressions would "leak" the assigned value as normal.
This commit is contained in:
Alex Lam S.L
2017-03-27 01:58:21 +08:00
committed by GitHub
parent 57ce5bd9e0
commit f001e4cb9d
2 changed files with 113 additions and 1 deletions

View File

@@ -2922,7 +2922,9 @@ merge(Compressor.prototype, {
&& (self.car.operator == "++" || self.car.operator == "--")) {
left = self.car.expression;
}
if (left) {
if (left
&& !(left instanceof AST_SymbolRef
&& left.definition().orig[0] instanceof AST_SymbolLambda)) {
var parent, field;
var cdr = self.cdr;
while (true) {