aboutsummaryrefslogtreecommitdiff
path: root/lib/scope.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-01 13:52:14 +0000
committerGitHub <noreply@github.com>2021-01-01 21:52:14 +0800
commit0417a69c3ef4922470b6891ad6039221059f5750 (patch)
tree5329008311c7303f54bc821aace798b7c47dd8e1 /lib/scope.js
parent2dbafbb4ee9c5cb82665299ee9343c80e96daad4 (diff)
downloadtracifyjs-0417a69c3ef4922470b6891ad6039221059f5750.tar.gz
tracifyjs-0417a69c3ef4922470b6891ad6039221059f5750.zip
enhance `collapse_vars` & `dead_code` (#4491)
Diffstat (limited to 'lib/scope.js')
-rw-r--r--lib/scope.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/scope.js b/lib/scope.js
index 4660c787..036df118 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -48,7 +48,6 @@ function SymbolDef(id, scope, orig, init) {
this.global = false;
this.id = id;
this.init = init;
- this.lambda = orig instanceof AST_SymbolLambda;
this.mangled_name = null;
this.name = orig.name;
this.orig = [ orig ];
@@ -352,11 +351,10 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
}
old_def.defun = new_def.scope;
old_def.forEach(function(node) {
- node.redef = true;
+ node.redef = old_def;
node.thedef = new_def;
node.reference(options);
});
- if (old_def.lambda) new_def.lambda = true;
if (new_def.undeclared) self.variables.set(name, new_def);
}
});