Fix scope check for 2nd+ lexical bindings (#9600)

This commit is contained in:
Daniel Tschinder
2019-02-27 15:53:28 -08:00
committed by GitHub
parent 9aec606c69
commit 5cb280f986
9 changed files with 29 additions and 2 deletions

View File

@@ -117,8 +117,7 @@ export default class ScopeHandler {
const scope = this.scopeStack[i];
if (
(scope.lexical.indexOf(name) > -1 &&
!(scope.flags & SCOPE_SIMPLE_CATCH) &&
scope.lexical[0] === name) ||
!(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical[0] === name)) ||
(!this.treatFunctionsAsVarInScope(scope) &&
scope.functions.indexOf(name) > -1)
) {