Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 1b5b7e6779be608e70c4fdc487871cc94bce30fd..009f36d136d80c01b678a9d85ad21adf6aa900b8 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -5561,6 +5561,12 @@ class NonPatternRewriter : public AstExpressionRewriter { |
return false; |
} |
+ void VisitObjectLiteralProperty(ObjectLiteralProperty* property) override { |
+ if (property == nullptr) return; |
+ // Do not rewrite (computed) key expressions |
+ AST_REWRITE_PROPERTY(Expression, property, value); |
+ } |
+ |
Parser* parser_; |
}; |
@@ -5581,8 +5587,7 @@ ObjectLiteralProperty* Parser::RewriteNonPatternObjectLiteralProperty( |
ObjectLiteralProperty* property, const ExpressionClassifier* classifier, |
bool* ok) { |
if (property != nullptr) { |
- Expression* key = RewriteNonPattern(property->key(), classifier, ok); |
- property->set_key(key); |
+ // Do not rewrite (computed) key expressions |
Expression* value = RewriteNonPattern(property->value(), classifier, ok); |
property->set_value(value); |
} |