| Index: src/parsing/parser.cc
|
| diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
|
| index 65271d9a5c3fcebd28baf1a2425d5295573c0fa5..a2bda669d9e6566b386d55728ece9b4c9aa72770 100644
|
| --- a/src/parsing/parser.cc
|
| +++ b/src/parsing/parser.cc
|
| @@ -796,7 +796,7 @@
|
| function_token_position, type, language_mode, ok);
|
| }
|
|
|
| -Expression* ParserTraits::ParseClassLiteral(
|
| +ClassLiteral* ParserTraits::ParseClassLiteral(
|
| Type::ExpressionClassifier* classifier, const AstRawString* name,
|
| Scanner::Location class_name_location, bool name_is_strict_reserved,
|
| int pos, bool* ok) {
|
| @@ -2267,8 +2267,8 @@
|
| variable_name = name;
|
| }
|
|
|
| - Expression* value = ParseClassLiteral(nullptr, name, scanner()->location(),
|
| - is_strict_reserved, pos, CHECK_OK);
|
| + ClassLiteral* value = ParseClassLiteral(nullptr, name, scanner()->location(),
|
| + is_strict_reserved, pos, CHECK_OK);
|
|
|
| VariableProxy* proxy = NewUnresolved(variable_name, LET);
|
| Declaration* declaration =
|
| @@ -5005,11 +5005,11 @@
|
| return result;
|
| }
|
|
|
| -Expression* Parser::ParseClassLiteral(ExpressionClassifier* classifier,
|
| - const AstRawString* name,
|
| - Scanner::Location class_name_location,
|
| - bool name_is_strict_reserved, int pos,
|
| - bool* ok) {
|
| +ClassLiteral* Parser::ParseClassLiteral(ExpressionClassifier* classifier,
|
| + const AstRawString* name,
|
| + Scanner::Location class_name_location,
|
| + bool name_is_strict_reserved, int pos,
|
| + bool* ok) {
|
| // All parts of a ClassDeclaration and ClassExpression are strict code.
|
| if (name_is_strict_reserved) {
|
| ReportMessageAt(class_name_location,
|
| @@ -5111,21 +5111,8 @@
|
| proxy->var()->set_initializer_position(end_pos);
|
| }
|
|
|
| - Block* do_block = factory()->NewBlock(nullptr, 1, false, pos);
|
| - do_block->set_scope(block_scope);
|
| - Variable* result_var =
|
| - block_scope->NewTemporary(ast_value_factory()->empty_string());
|
| - DoExpression* do_expr = factory()->NewDoExpression(do_block, result_var, pos);
|
| -
|
| - ClassLiteral* class_literal = factory()->NewClassLiteral(
|
| - proxy, extends, constructor, properties, pos, end_pos);
|
| -
|
| - do_block->statements()->Add(
|
| - factory()->NewExpressionStatement(class_literal, pos), zone());
|
| - do_expr->set_represented_function(constructor);
|
| - Rewriter::Rewrite(this, do_expr, ast_value_factory());
|
| -
|
| - return do_expr;
|
| + return factory()->NewClassLiteral(block_scope, proxy, extends, constructor,
|
| + properties, pos, end_pos);
|
| }
|
|
|
|
|
| @@ -6119,8 +6106,8 @@
|
| if (function != nullptr) {
|
| function->set_raw_name(name);
|
| } else {
|
| - DCHECK(value->IsDoExpression());
|
| - value->AsDoExpression()->represented_function()->set_raw_name(name);
|
| + DCHECK(value->IsClassLiteral());
|
| + value->AsClassLiteral()->constructor()->set_raw_name(name);
|
| }
|
| }
|
|
|
|
|