Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index ee2a696d458b2441135e61a88fcb25f748e7db68..a11a5d390e5eb6543892f61566dacb0e08639797 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -4906,6 +4906,7 @@ ClassLiteral* Parser::ParseClassLiteral(const AstRawString* name, |
ExpressionClassifier classifier; |
extends = ParseLeftHandSideExpression(&classifier, CHECK_OK); |
ValidateExpression(&classifier, CHECK_OK); |
+ extends = ParserTraits::RewriteExpression(extends); |
} else { |
block_scope->set_start_position(scanner()->location().end_pos); |
} |
@@ -4932,6 +4933,7 @@ ClassLiteral* Parser::ParseClassLiteral(const AstRawString* name, |
&checker, in_class, has_extends, is_static, &is_computed_name, |
&has_seen_constructor, &classifier, &name, CHECK_OK); |
ValidateExpression(&classifier, CHECK_OK); |
+ property = ParserTraits::RewriteObjectLiteralProperty(property); |
if (has_seen_constructor && constructor == NULL) { |
constructor = GetPropertyValue(property)->AsFunctionLiteral(); |
@@ -6500,6 +6502,35 @@ void ParserTraits::RewriteDestructuringAssignments() { |
} |
+Expression* ParserTraits::RewriteExpression(Expression* expr) { |
+ return parser_->RewriteExpression(expr); |
+} |
+ |
+ |
+ObjectLiteralProperty* ParserTraits::RewriteObjectLiteralProperty( |
+ ObjectLiteralProperty* property) { |
+ return parser_->RewriteObjectLiteralProperty(property); |
+} |
+ |
+ |
+Expression* Parser::RewriteExpression(Expression* expr) { |
+ // TODO(nikolaos): For the time being, this does no rewriting at all. |
+ return expr; |
+} |
+ |
+ |
+ObjectLiteralProperty* Parser::RewriteObjectLiteralProperty( |
+ ObjectLiteralProperty* property) { |
+ if (property != nullptr) { |
+ Expression* key = RewriteExpression(property->key()); |
+ property->set_key(key); |
+ Expression* value = RewriteExpression(property->value()); |
+ property->set_value(value); |
+ } |
+ return property; |
+} |
+ |
+ |
void Parser::RewriteDestructuringAssignments() { |
FunctionState* func = function_state_; |
if (!allow_harmony_destructuring_assignment()) return; |