| Index: src/parsing/parser.cc
|
| diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
|
| index 0e97efdf94793c904171b4db9495dd39b7b52b53..f6a0131707310c89d319e9b0e24f1849b9005ba5 100644
|
| --- a/src/parsing/parser.cc
|
| +++ b/src/parsing/parser.cc
|
| @@ -2282,9 +2282,7 @@ Statement* Parser::ParseClassDeclaration(ZoneList<const AstRawString*>* names,
|
| return assignment_statement;
|
| }
|
|
|
| -
|
| -Block* Parser::ParseBlock(ZoneList<const AstRawString*>* labels,
|
| - bool finalize_block_scope, bool* ok) {
|
| +Block* Parser::ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok) {
|
| // The harmony mode uses block elements instead of statements.
|
| //
|
| // Block ::
|
| @@ -2310,19 +2308,12 @@ Block* Parser::ParseBlock(ZoneList<const AstRawString*>* labels,
|
| }
|
| Expect(Token::RBRACE, CHECK_OK);
|
| block_scope->set_end_position(scanner()->location().end_pos);
|
| - if (finalize_block_scope) {
|
| - block_scope = block_scope->FinalizeBlockScope();
|
| - }
|
| + block_scope = block_scope->FinalizeBlockScope();
|
| body->set_scope(block_scope);
|
| return body;
|
| }
|
|
|
|
|
| -Block* Parser::ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok) {
|
| - return ParseBlock(labels, true, ok);
|
| -}
|
| -
|
| -
|
| Block* Parser::DeclarationParsingResult::BuildInitializationBlock(
|
| ZoneList<const AstRawString*>* names, bool* ok) {
|
| Block* result = descriptor.parser->factory()->NewBlock(
|
| @@ -4207,13 +4198,12 @@ DoExpression* Parser::ParseDoExpression(bool* ok) {
|
| Expect(Token::DO, CHECK_OK);
|
| Variable* result =
|
| scope()->NewTemporary(ast_value_factory()->dot_result_string());
|
| - Block* block = ParseBlock(nullptr, false, CHECK_OK);
|
| + Block* block = ParseBlock(nullptr, CHECK_OK);
|
| DoExpression* expr = factory()->NewDoExpression(block, result, pos);
|
| - if (!Rewriter::Rewrite(this, expr, ast_value_factory())) {
|
| + if (!Rewriter::Rewrite(this, scope(), expr, ast_value_factory())) {
|
| *ok = false;
|
| return nullptr;
|
| }
|
| - block->set_scope(block->scope()->FinalizeBlockScope());
|
| return expr;
|
| }
|
|
|
| @@ -6601,7 +6591,7 @@ Expression* ParserTraits::RewriteYieldStar(
|
|
|
| Variable* dot_result = scope->NewTemporary(avfactory->dot_result_string());
|
| yield_star = factory->NewDoExpression(do_block, dot_result, nopos);
|
| - Rewriter::Rewrite(parser_, yield_star, avfactory);
|
| + Rewriter::Rewrite(parser_, scope, yield_star, avfactory);
|
| }
|
|
|
| return yield_star;
|
|
|