aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-27 01:58:21 +0800
committerGitHub <noreply@github.com>2017-03-27 01:58:21 +0800
commitf001e4cb9d5bfe56e25db552bb7ab0951a142a99 (patch)
treee20c946d08e85aca66e67b7532d2d64b1fd4d482 /lib/compress.js
parent57ce5bd9e085546a5c1cb8dd4a3ea71ab6c56f26 (diff)
downloadtracifyjs-f001e4cb9d5bfe56e25db552bb7ab0951a142a99.tar.gz
tracifyjs-f001e4cb9d5bfe56e25db552bb7ab0951a142a99.zip
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.
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 590015ff..8350ba25 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -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) {