aboutsummaryrefslogtreecommitdiff
path: root/lib/scope.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-10-12 02:26:56 +0100
committerGitHub <noreply@github.com>2020-10-12 09:26:56 +0800
commitb1b8898e7c3ced21c601b3a8d618aff2fd468d63 (patch)
treeaad6847f67f564c52685e49d7e02017cd25c8086 /lib/scope.js
parent55451e7b78c1765c6c3011d880c7980c10b7330f (diff)
downloadtracifyjs-b1b8898e7c3ced21c601b3a8d618aff2fd468d63.tar.gz
tracifyjs-b1b8898e7c3ced21c601b3a8d618aff2fd468d63.zip
fix corner case in `functions` (#4192)
fixes #4191
Diffstat (limited to 'lib/scope.js')
-rw-r--r--lib/scope.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/scope.js b/lib/scope.js
index fa558640..c3bb3fa7 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -240,12 +240,8 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
}
// ensure compression works if `const` reuses a scope variable
if (node instanceof AST_SymbolConst) {
- var def = node.definition();
- var redef = def.redefined();
- if (redef) {
- if (!redef.const_redefs) redef.const_redefs = [];
- redef.const_redefs.push(def);
- }
+ var redef = node.definition().redefined();
+ if (redef) redef.const_redefs = true;
return true;
}
});