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

Unified Diff: src/parsing/parser.h

Issue 2637403008: [async-iteration] add support for for-await-of loops in Async Functions (Closed)
Patch Set: ...and uncomment the previously failing tests... Created 3 years, 10 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.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index 6523ca7de583e4e8ae5373b4960aa85c94238d3f..db4f7e606df127123898100c1d9d08da324833eb 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -456,19 +456,25 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW()
};
- // !%_IsJSReceiver(result = iterator.next()) &&
- // %ThrowIteratorResultNotAnObject(result)
+ // [if (IteratorType == kAsync)]
+ // !%_IsJSReceiver(result = Await(iterator.next()) &&
+ // %ThrowIteratorResultNotAnObject(result)
+ // [else]
+ // !%_IsJSReceiver(result = iterator.next()) &&
+ // %ThrowIteratorResultNotAnObject(result)
+ // [endif]
Expression* BuildIteratorNextResult(Expression* iterator, Variable* result,
- int pos);
+ IteratorType type, int pos);
// Initialize the components of a for-in / for-of statement.
Statement* InitializeForEachStatement(ForEachStatement* stmt,
Expression* each, Expression* subject,
Statement* body, int each_keyword_pos);
- Statement* InitializeForOfStatement(ForOfStatement* stmt, Expression* each,
+ Statement* InitializeForOfStatement(ForEachStatement* stmt, Expression* each,
nickie 2017/02/14 13:35:24 Maybe it's trivial, but it strikes me as odd that
caitp 2017/02/14 14:16:37 The purpose was to allow InitializeForOfStatement
adamk 2017/02/14 18:47:53 I can think of a variety of solutions for this tha
caitp 2017/02/14 21:40:58 Done via NewForOf...
Expression* iterable, Statement* body,
- bool finalize,
+ bool finalize, IteratorType type,
int next_result_pos = kNoSourcePosition);
+
Block* RewriteForVarInLegacy(const ForInfo& for_info);
void DesugarBindingInForEachStatement(ForInfo* for_info, Block** body_block,
Expression** each_variable, bool* ok);
@@ -640,16 +646,18 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
void FinalizeIteratorUse(Scope* use_scope, Variable* completion,
Expression* condition, Variable* iter,
- Block* iterator_use, Block* result);
+ Block* iterator_use, Block* result,
+ IteratorType type);
Statement* FinalizeForOfStatement(ForOfStatement* loop, Variable* completion,
- int pos);
+ IteratorType type, int pos);
void BuildIteratorClose(ZoneList<Statement*>* statements, Variable* iterator,
Variable* input, Variable* output);
void BuildIteratorCloseForCompletion(Scope* scope,
ZoneList<Statement*>* statements,
Variable* iterator,
- Expression* completion);
+ Expression* completion,
+ IteratorType type);
Statement* CheckCallable(Variable* var, Expression* error, int pos);
V8_INLINE Expression* RewriteAwaitExpression(Expression* value, int pos);

Powered by Google App Engine
This is Rietveld 408576698