diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-10-14 18:15:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-14 18:15:40 +0800 |
commit | 736019b767548268044e665bd6cde4b5e34c0bd3 (patch) | |
tree | c64e48fda578e3cbaddbcbf1d9c8929dede44961 /lib | |
parent | a39bdb584097b376250e6d09cd9ee9453b9f43de (diff) | |
download | tracifyjs-736019b767548268044e665bd6cde4b5e34c0bd3.tar.gz tracifyjs-736019b767548268044e665bd6cde4b5e34c0bd3.zip |
fix corner cases in `ie8` (#3472)
fixes #3471
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js index 06ba43c0..be9e8dc8 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -3716,6 +3716,7 @@ merge(Compressor.prototype, { if (!def.value) { head.push(def); } else if (compressor.option("functions") + && !compressor.option("ie8") && def.value === def.name.fixed_value() && def.value instanceof AST_Function && !(def.value.name && def.value.name.definition().assignments) @@ -6183,7 +6184,9 @@ merge(Compressor.prototype, { var fn = node.fixed_value(); if (!(fn instanceof AST_Lambda)) return; if (!fn.name) return; - if (fixed.variables.get(fn.name.name) !== fn.name.definition()) return; + var fn_def = fn.name.definition(); + if (fn_def.scope !== fn.name.scope) return; + if (fixed.variables.get(fn.name.name) !== fn_def) return; fn.name = fn.name.clone(); var value_def = value.variables.get(fn.name.name) || value.def_function(fn.name); node.thedef = value_def; |