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

Unified Diff: src/ast/ast.h

Issue 2917263002: Move generator-close on exception from the generator function to the GeneratorResume builtin. (Closed)
Patch Set: Address comments & rebase Created 3 years, 6 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 | « no previous file | src/builtins/builtins-definitions.h » ('j') | src/interpreter/bytecode-generator.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 93189d5f622043326f5f9f425dd83a2fc6840a4d..aab6b5f35a766d29babdd074c1a3612b7b6427bf 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -2542,6 +2542,10 @@ class Suspend final : public Expression {
return suspend_id() > 0 && (flags() & SuspendFlags::kAsyncGeneratorAwait) ==
SuspendFlags::kAsyncGenerator;
}
+ inline bool IsNonInitialGeneratorYield() const {
+ // Return true if is_generator() && !is_await() && yield_id() > 0
+ return suspend_id() > 0 && (flags() == SuspendFlags::kGeneratorYield);
+ }
void set_generator_object(Expression* e) { generator_object_ = e; }
void set_expression(Expression* e) { expression_ = e; }
« no previous file with comments | « no previous file | src/builtins/builtins-definitions.h » ('j') | src/interpreter/bytecode-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698