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

Unified Diff: src/parsing/parser.h

Issue 2622833002: WIP [esnext] implement async iteration proposal (Closed)
Patch Set: simplify AsyncIteratorValueUnwrap Created 3 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/objects-printer.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index 45ef959ed44644d38db9b75ae6a459bc676f51b9..1d18367955e4466909b8e54e554381add2915cbc 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -28,6 +28,8 @@ class ScriptData;
class ParserTarget;
class ParserTargetScope;
+enum class IteratorType { kNormal, kAsync };
+
class FunctionEntry BASE_EMBEDDED {
public:
enum {
@@ -448,7 +450,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
// !%_IsJSReceiver(result = iterator.next()) &&
// %ThrowIteratorResultNotAnObject(result)
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,
@@ -458,6 +460,9 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
Expression* iterable, Statement* body,
bool finalize,
int next_result_pos = kNoSourcePosition);
+ Statement* InitializeForAwaitOfStatement(
+ ForEachStatement* for_of, Expression* each, Expression* iterable,
+ Statement* body, bool finalize, int next_result_pos = kNoSourcePosition);
Block* RewriteForVarInLegacy(const ForInfo& for_info);
void DesugarBindingInForEachStatement(ForInfo* for_info, Block** body_block,
Expression** each_variable, bool* ok);
@@ -635,16 +640,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);
+ Variable* input, Variable* output, IteratorType type);
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);
« no previous file with comments | « src/objects-printer.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698