diff --git a/packages/babel-parser/src/util/scope.js b/packages/babel-parser/src/util/scope.js index 2e163b62260e..21921055e991 100644 --- a/packages/babel-parser/src/util/scope.js +++ b/packages/babel-parser/src/util/scope.js @@ -174,9 +174,7 @@ export default class ScopeHandler { } checkLocalExport(id: N.Identifier) { - const currentScope = this.currentScope(); - const scope = - currentScope.flags & SCOPE_PROGRAM ? currentScope : this.scopeStack[0]; + const scope = this.currentScope(); if ( scope.lexical.indexOf(id.name) === -1 && scope.var.indexOf(id.name) === -1 &&