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

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: 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.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 0048b8da698b718cc01671f52ab659b905427c2e..fe7344e5fc2c250a8fb76a4c024bf002e70ee1be 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) {

Powered by Google App Engine
This is Rietveld 408576698