diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-04-17 14:19:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 21:19:18 +0800 |
commit | 15a3ebd467ea1f88b55affb0c3cc2d218fad3718 (patch) | |
tree | 20514b7160ba49818c7b57104970fa853e86f8aa /lib | |
parent | 9110fac9a28d18981e2297f4c84f4c18037ba88e (diff) | |
download | tracifyjs-15a3ebd467ea1f88b55affb0c3cc2d218fad3718.tar.gz tracifyjs-15a3ebd467ea1f88b55affb0c3cc2d218fad3718.zip |
fix corner cases in `join_vars` (#3787)
fixes #3786
fixes #3788
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js index 18cbd05e..2491757f 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -2365,8 +2365,9 @@ merge(Compressor.prototype, { if (expr.operator != "=") break; var lhs = expr.left; if (!(lhs instanceof AST_SymbolRef)) break; + if (is_undeclared_ref(lhs)) break; var def = lhs.definition(); - if (def.scope !== scope) break; + if (def.scope !== definitions[0].name.scope) break; var name = make_node(AST_SymbolVar, lhs, lhs); definitions.push(make_node(AST_VarDef, expr, { name: name, |