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

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: Add TODO 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
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index e4947f208a2fa631dae8d5202ebd722ad8486d86..8077a05a638a4e0557e65a10a3b2e418e5d9658f 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -2544,6 +2544,24 @@ 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()) {
+ // TODO(neis): allow escaping into closures?
+ 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;
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698