From 0a1c9b34cea8bf740c70d5457ef9e3bd37778607 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sat, 21 Mar 2020 00:55:24 +0800 Subject: fix corner case in `evaluate` & `ie8` (#3751) fixes #3750 --- lib/scope.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/scope.js') diff --git a/lib/scope.js b/lib/scope.js index 896efacc..35d97e12 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -219,7 +219,12 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) { var redef; while (redef = new_def.redefined()) new_def = redef; } else { - new_def = self.globals.get(name) || scope.def_variable(node); + new_def = self.globals.get(name); + } + if (new_def) { + new_def.orig.push(node); + } else { + new_def = scope.def_variable(node); } old_def.orig.concat(old_def.references).forEach(function(node) { node.thedef = new_def; -- cgit v1.2.3