Index: src/parsing/parser.h |
diff --git a/src/parsing/parser.h b/src/parsing/parser.h |
index f838e3a518534aa345151d404d7d4d866b5550c1..ebf85213ef7738dd7ddecbabe47dc0e3b428b56f 100644 |
--- a/src/parsing/parser.h |
+++ b/src/parsing/parser.h |
@@ -466,6 +466,9 @@ class ParserTraits { |
MessageTemplate::Template message, |
const AstRawString* arg, int pos); |
+ void FinalizeIteratorUse(Variable* completion, Expression* condition, |
+ Variable* iter, Block* iterator_use, Block* result); |
+ |
Statement* FinalizeForOfStatement(ForOfStatement* loop, int pos); |
// Reporting errors. |
@@ -674,9 +677,11 @@ class ParserTraits { |
void BuildIteratorClose(ZoneList<Statement*>* statements, Variable* iterator, |
Maybe<Variable*> input, Variable* output); |
+ |
void BuildIteratorCloseForCompletion( |
ZoneList<Statement*>* statements, Variable* iterator, |
- Variable* body_threw); |
+ Variable* completion); |
+ |
Statement* CheckCallable(Variable* var, Expression* error); |
}; |
@@ -703,6 +708,16 @@ class Parser : public ParserBase<ParserTraits> { |
void Internalize(Isolate* isolate, Handle<Script> script, bool error); |
void HandleSourceURLComments(Isolate* isolate, Handle<Script> script); |
+ // Runtime encoding of different completion modes. |
+ enum CompletionKind { |
adamk
2016/03/07 20:28:05
Can you make this an enum class? Otherwise you've
neis
2016/03/08 13:40:10
If I make it an enum class, then instead of eg NOR
adamk
2016/03/08 18:41:13
Oh, I forgot about that bit. The thing that bother
|
+ NORMAL = 0, |
+ THROW = 1, |
+ BREAK = 2, |
+ CONTINUE = 4, |
+ RETURN = 8, |
+ ABRUPT = THROW | BREAK | CONTINUE | RETURN |
adamk
2016/03/07 20:28:05
Besides this line, do you actually use this enum a
neis
2016/03/08 13:40:10
Alright, changed it back to three values.
|
+ }; |
+ |
private: |
friend class ParserTraits; |
@@ -917,6 +932,7 @@ class Parser : public ParserBase<ParserTraits> { |
Statement* ParseForStatement(ZoneList<const AstRawString*>* labels, bool* ok); |
Statement* ParseThrowStatement(bool* ok); |
Expression* MakeCatchContext(Handle<String> id, VariableProxy* value); |
+ |
class DontCollectExpressionsInTailPositionScope; |
class CollectExpressionsInTailPositionToListScope; |
TryStatement* ParseTryStatement(bool* ok); |