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

Unified Diff: src/parser.cc

Issue 14582007: Implement yield* (delegating yield) (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Fix asm nits; rework test suite to test yield* on everything Created 7 years, 7 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/ia32/full-codegen-ia32.cc ('k') | src/v8natives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 33b5fab3fc8c6b9cd198a99384fe4bf60111d738..35f2323d77572b13af7f568058baff33d3a77c6f 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -3113,7 +3113,12 @@ Expression* Parser::ParseYieldExpression(bool* ok) {
Expression* generator_object = factory()->NewVariableProxy(
current_function_state_->generator_object_variable());
Expression* expression = ParseAssignmentExpression(false, CHECK_OK);
- return factory()->NewYield(generator_object, expression, kind, position);
+ Yield* yield =
+ factory()->NewYield(generator_object, expression, kind, position);
+ if (kind == Yield::DELEGATING) {
+ yield->set_index(current_function_state_->NextHandlerIndex());
+ }
+ return yield;
}
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698