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

Unified Diff: src/parsing/parser-base.h

Issue 1620253003: Implement the function.sent proposal. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index 73bf3e80e8944a80d4b9ce2a2c9d39f99216aa53..c0b892e954fd0d7a48b686c8450c5cdbe55574f8 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -2586,6 +2586,23 @@ ParserBase<Traits>::ParseMemberExpression(ExpressionClassifier* classifier,
Consume(Token::FUNCTION);
int function_token_position = position();
+
+ if (FLAG_harmony_function_sent && Check(Token::PERIOD)) {
+ // function.sent
+
+ int pos = position();
+ ExpectContextualKeyword(CStrVector("sent"), CHECK_OK);
+
+ if (!is_generator()) {
rossberg 2016/01/22 14:13:06 This may not be good enough. Like other magic cons
neis 2016/01/27 16:49:40 Done.
+ ReportMessageAt(scanner()->location(),
+ MessageTemplate::kUnexpectedFunctionSent);
+ *ok = false;
+ return this->EmptyExpression();
+ }
+
+ return this->FunctionSentExpression(scope_, factory(), pos);
+ }
+
bool is_generator = Check(Token::MUL);
IdentifierT name = this->EmptyIdentifier();
bool is_strict_reserved_name = false;

Powered by Google App Engine
This is Rietveld 408576698