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

Unified Diff: src/parsing/parser.cc

Issue 1949223002: Disallow yield in computed property names of class expressions in params (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added a few more tests Created 4 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
« no previous file with comments | « no previous file | src/parsing/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index b1013296dc5186963477144f72539bf230b85af8..ce3dd20d359310a1b89eda3d05c88551127537d8 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -4678,12 +4678,16 @@ ClassLiteral* Parser::ParseClassLiteral(ExpressionClassifier* classifier,
const bool is_static = false;
bool is_computed_name = false; // Classes do not care about computed
// property names here.
- ExpressionClassifier classifier(this);
+ ExpressionClassifier property_classifier(this);
const AstRawString* property_name = nullptr;
ObjectLiteral::Property* property = ParsePropertyDefinition(
&checker, in_class, has_extends, is_static, &is_computed_name,
- &has_seen_constructor, &classifier, &property_name, CHECK_OK);
- RewriteNonPattern(&classifier, CHECK_OK);
+ &has_seen_constructor, &property_classifier, &property_name, CHECK_OK);
+ RewriteNonPattern(&property_classifier, CHECK_OK);
+ if (classifier != nullptr) {
+ classifier->Accumulate(&property_classifier,
+ ExpressionClassifier::ExpressionProductions);
+ }
if (has_seen_constructor && constructor == NULL) {
constructor = GetPropertyValue(property)->AsFunctionLiteral();
« no previous file with comments | « no previous file | src/parsing/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698