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

Unified Diff: src/parsing/parser.cc

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.h ('k') | src/parsing/parser-base.h » ('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 5377e1694d4cfaad0c1f782c9bd82b58b8fca809..a10b8220bb61bb3f2f26ac71b39702407949a411 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -643,6 +643,19 @@ Expression* ParserTraits::NewTargetExpression(Scope* scope,
}
+Expression* ParserTraits::FunctionSentExpression(Scope* scope,
+ AstNodeFactory* factory,
+ int pos) {
+ // We desugar function.sent into %GeneratorGetInput(generator).
+ Zone* zone = parser_->zone();
+ ZoneList<Expression*>* args = new (zone) ZoneList<Expression*>(1, zone);
+ VariableProxy* generator = factory->NewVariableProxy(
+ parser_->function_state_->generator_object_variable());
+ args->Add(generator, zone);
+ return factory->NewCallRuntime(Runtime::kGeneratorGetInput, args, pos);
+}
+
+
Expression* ParserTraits::DefaultConstructor(bool call_super, Scope* scope,
int pos, int end_pos,
LanguageMode mode) {
« no previous file with comments | « src/parsing/parser.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698