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

Unified Diff: src/preparser.h

Issue 1407633002: [es6] parse arrow ConciseBody with accept_IN flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove pesky stray var Created 5 years, 2 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/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index d890ae5c216d7b497d0f3801288bd2fe7c4123fb..1094884a2fa69ac17dd26f237a7d4dfa6754169d 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -714,9 +714,10 @@ class ParserBase : public Traits {
ExpressionT ParseMemberExpression(ExpressionClassifier* classifier, bool* ok);
ExpressionT ParseMemberExpressionContinuation(
ExpressionT expression, ExpressionClassifier* classifier, bool* ok);
- ExpressionT ParseArrowFunctionLiteral(
- const FormalParametersT& parameters,
- const ExpressionClassifier& classifier, bool* ok);
+ ExpressionT ParseArrowFunctionLiteral(bool accept_IN,
+ const FormalParametersT& parameters,
+ const ExpressionClassifier& classifier,
+ bool* ok);
ExpressionT ParseTemplateLiteral(ExpressionT tag, int start,
ExpressionClassifier* classifier, bool* ok);
void AddTemplateExpression(ExpressionT);
@@ -2946,7 +2947,7 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN,
duplicate_loc);
}
expression = this->ParseArrowFunctionLiteral(
- parameters, arrow_formals_classifier, CHECK_OK);
+ accept_IN, parameters, arrow_formals_classifier, CHECK_OK);
return expression;
}
@@ -3882,7 +3883,7 @@ bool ParserBase<Traits>::IsNextLetKeyword() {
template <class Traits>
typename ParserBase<Traits>::ExpressionT
ParserBase<Traits>::ParseArrowFunctionLiteral(
- const FormalParametersT& formal_parameters,
+ bool accept_IN, const FormalParametersT& formal_parameters,
const ExpressionClassifier& formals_classifier, bool* ok) {
if (peek() == Token::ARROW && scanner_->HasAnyLineTerminatorBeforeNext()) {
// ASI inserts `;` after arrow parameters if a line terminator is found.
@@ -3940,7 +3941,7 @@ ParserBase<Traits>::ParseArrowFunctionLiteral(
parenthesized_function_ = false;
ExpressionClassifier classifier;
ExpressionT expression =
- ParseAssignmentExpression(true, &classifier, CHECK_OK);
+ ParseAssignmentExpression(accept_IN, &classifier, CHECK_OK);
ValidateExpression(&classifier, CHECK_OK);
body = this->NewStatementList(1, zone());
this->AddParameterInitializationBlock(formal_parameters, body, CHECK_OK);
« no previous file with comments | « src/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698