| Index: src/parsing/preparser.cc
|
| diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
|
| index cc7f9f52bdf4dc73528ff0683fca60d74cec8f3f..7f859d2bbe8cc741a734600041d11f8f47a3e0c1 100644
|
| --- a/src/parsing/preparser.cc
|
| +++ b/src/parsing/preparser.cc
|
| @@ -297,26 +297,12 @@ void PreParser::DeclareAndInitializeVariables(
|
| ZoneList<const AstRawString*>* names, bool* ok) {
|
| if (declaration->pattern.variables_ != nullptr) {
|
| DCHECK(FLAG_lazy_inner_functions);
|
| - /* Mimic what Parser does when declaring variables (see
|
| - Parser::PatternRewriter::VisitVariableProxy).
|
| -
|
| - var + no initializer -> RemoveUnresolved
|
| - let / const + no initializer -> RemoveUnresolved
|
| - var + initializer -> RemoveUnresolved followed by NewUnresolved
|
| - let / const + initializer -> RemoveUnresolved
|
| - */
|
| Scope* scope = declaration_descriptor->hoist_scope;
|
| if (scope == nullptr) {
|
| scope = this->scope();
|
| }
|
| - if (declaration->initializer.IsEmpty() ||
|
| - (declaration_descriptor->mode == VariableMode::LET ||
|
| - declaration_descriptor->mode == VariableMode::CONST)) {
|
| - for (auto variable : *(declaration->pattern.variables_)) {
|
| - declaration_descriptor->scope->RemoveUnresolved(variable);
|
| - }
|
| - }
|
| for (auto variable : *(declaration->pattern.variables_)) {
|
| + declaration_descriptor->scope->RemoveUnresolved(variable);
|
| scope->DeclareVariableName(variable->raw_name(),
|
| declaration_descriptor->mode);
|
| }
|
|
|