diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-01-09 20:20:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-10 04:20:43 +0800 |
commit | 0818d396c5cca408f161422800b79cf825ab5b9f (patch) | |
tree | 6254477faa909a73b1627109c965faa268e75e07 /lib/scope.js | |
parent | 770f3ba5fe6bba0768e881dd3fe46b2a21d4a5df (diff) | |
download | tracifyjs-0818d396c5cca408f161422800b79cf825ab5b9f.tar.gz tracifyjs-0818d396c5cca408f161422800b79cf825ab5b9f.zip |
fix corner case in `mangle` (#4528)
fixes #4527
Diffstat (limited to 'lib/scope.js')
-rw-r--r-- | lib/scope.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/scope.js b/lib/scope.js index ea662815..f4a18ca7 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -611,6 +611,7 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options) { if (!(sym instanceof AST_SymbolConst)) return false; var scope = def.scope.resolve(); if (def.scope === scope) return false; + if (def.scope.parent_scope.find_variable(sym.name)) return false; redef = scope.def_variable(sym); scope.to_mangle.push(redef); } |