File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -819,6 +819,7 @@ public Label visit(Program nd, Context c) {
819819 // add all declared global (or module-scoped) names, both non-lexical and lexical
820820 scopeManager .addNames (scopeManager .collectDeclaredNames (nd , isStrict , false , DeclKind .none ));
821821 scopeManager .addNames (scopeManager .collectDeclaredNames (nd , isStrict , true , DeclKind .none ));
822+ scopeManager .addVariables ("this" );
822823
823824 visitAll (nd .getBody (), toplevelLabel );
824825
@@ -1070,6 +1071,9 @@ private void extractFunction(IFunction nd, Label key) {
10701071
10711072 scopeManager .enterScope ((Node ) nd );
10721073 scopeManager .addNames (locals );
1074+ if (!(nd instanceof ArrowFunctionExpression )) {
1075+ scopeManager .addVariables ("this" );
1076+ }
10731077
10741078 // The name of a function expression binds to its own scope.
10751079 if (nd .getId () != null && nd instanceof AFunctionExpression ) {
You can’t perform that action at this time.
0 commit comments