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

Unified Diff: src/parsing/preparser.cc

Issue 2329703002: Private fields
Patch Set: some comments Created 4 years, 3 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 | « src/parsing/preparser.h ('k') | src/parsing/scanner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index 8eb11366653576f3e68dbec44ec5813d4e59db0d..f0fee8f3e9ba892f9966b12f15243dd9d9d910e0 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -854,11 +854,13 @@ PreParserExpression PreParser::ParseClassLiteral(
Expect(Token::LBRACE, CHECK_OK);
while (peek() != Token::RBRACE) {
if (Check(Token::SEMICOLON)) continue;
+ IdentifierT private_name;
bool is_computed_name = false; // Classes do not care about computed
// property names here.
ExpressionClassifier property_classifier(this);
- ParseClassPropertyDefinition(&checker, has_extends, &is_computed_name,
- &has_seen_constructor, CHECK_OK);
+ ParseClassPropertyDefinition(&checker, has_extends, &private_name,
+ &is_computed_name, &has_seen_constructor,
+ CHECK_OK);
ValidateExpression(CHECK_OK);
impl()->AccumulateFormalParameterContainmentErrors();
}
@@ -902,6 +904,15 @@ PreParserExpression PreParser::ParseDoExpression(bool* ok) {
return PreParserExpression::Default();
}
+PreParserExpression PreParser::ParsePrivateFieldReference(
+ PreParserExpression base, bool* ok) {
+ // PrimaryExpression ::
+ // PrivateName
+ Expect(Token::HASH, CHECK_OK);
+ ParseIdentifierName(CHECK_OK);
+ return PreParserExpression::Property();
+}
+
void PreParser::ParseAsyncArrowSingleExpressionBody(PreParserStatementList body,
bool accept_IN, int pos,
bool* ok) {
« no previous file with comments | « src/parsing/preparser.h ('k') | src/parsing/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698