aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-17 09:58:05 +0800
committerGitHub <noreply@github.com>2019-10-17 09:58:05 +0800
commit0785a15aceaee3f4a31d9693a4230cbf0477ea81 (patch)
tree35c3685bd3adeca406922f61021659549965950f /lib/compress.js
parentb1279a46d9801bbc3eee8c4ea90422dd7582b928 (diff)
downloadtracifyjs-0785a15aceaee3f4a31d9693a4230cbf0477ea81.tar.gz
tracifyjs-0785a15aceaee3f4a31d9693a4230cbf0477ea81.zip
fix corner case in `dead_code` & `ie8` (#3494)
fixes #3493
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index e39435c7..4b0ceee4 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -888,8 +888,10 @@ merge(Compressor.prototype, {
});
AST_SymbolRef.DEFMETHOD("is_immutable", function() {
- var orig = this.definition().orig;
- return orig.length == 1 && orig[0] instanceof AST_SymbolLambda;
+ var def = this.definition();
+ if (def.orig.length != 1) return false;
+ var sym = def.orig[0];
+ return sym instanceof AST_SymbolLambda && def.scope.name === sym;
});
function is_lhs_read_only(lhs, compressor) {