Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1170)

Unified Diff: src/preparser.h

Issue 1129083009: [destructuring] Support computed property names in patterns. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Minor test fix Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index b08888834eb9ba4a42c557f8cd2d3dfa849c9520..116a8eac9b891721e208bea92d9f3b7e4ad30528 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2560,8 +2560,10 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParsePropertyName(
if (allow_harmony_computed_property_names_) {
*is_computed_name = true;
Consume(Token::LBRACK);
- ExpressionT expression =
- ParseAssignmentExpression(true, classifier, CHECK_OK);
+ ExpressionClassifier computed_name_classifier;
+ ExpressionT expression = ParseAssignmentExpression(
+ true, &computed_name_classifier, CHECK_OK);
+ classifier->AccumulateReclassifyingAsPattern(computed_name_classifier);
Expect(Token::RBRACK, CHECK_OK);
return expression;
}

Powered by Google App Engine
This is Rietveld 408576698