Chromium Code Reviews| Index: src/parsing/parser.h |
| diff --git a/src/parsing/parser.h b/src/parsing/parser.h |
| index 1a5e2f12312e659e1c7f8dc235456c33f174f5c9..12c41ae243de4909a627a23b9f1cc6d6bef1d6c0 100644 |
| --- a/src/parsing/parser.h |
| +++ b/src/parsing/parser.h |
| @@ -287,7 +287,6 @@ class Parser : public ParserBase<Parser> { |
| const AstRawString* label); |
| Expression* RewriteReturn(Expression* return_value, int pos); |
| - DoExpression* ParseDoExpression(bool* ok); |
| Expression* ParseYieldStarExpression(bool* ok); |
| class PatternRewriter final : public AstVisitor<PatternRewriter> { |
| @@ -374,12 +373,7 @@ class Parser : public ParserBase<Parser> { |
| CaseClause* ParseCaseClause(bool* default_seen_ptr, bool* ok); |
| Statement* ParseSwitchStatement(ZoneList<const AstRawString*>* labels, |
| bool* ok); |
| - DoWhileStatement* ParseDoWhileStatement(ZoneList<const AstRawString*>* labels, |
| - bool* ok); |
| - WhileStatement* ParseWhileStatement(ZoneList<const AstRawString*>* labels, |
| - bool* ok); |
| Statement* ParseForStatement(ZoneList<const AstRawString*>* labels, bool* ok); |
| - Statement* ParseThrowStatement(bool* ok); |
| Expression* MakeCatchContext(Handle<String> id, VariableProxy* value); |
| TryStatement* ParseTryStatement(bool* ok); |
| @@ -407,7 +401,14 @@ class Parser : public ParserBase<Parser> { |
| FunctionKind kind, FunctionBodyType type, |
| bool accept_IN, int pos, bool* ok); |
| - void RewriteDoExpression(Expression* expr, bool* ok); |
| + Expression* RewriteDoExpression(Block* body, int pos, bool* ok); |
| + |
| + template <typename Loop> |
| + V8_INLINE Loop* InitializeLoop(Loop* loop, Expression* cond, |
| + Statement* body) { |
| + if (loop != nullptr) loop->Initialize(cond, body); |
|
adamk
2016/09/08 18:44:47
I don't understand, when can loop be null?
nickie
2016/09/09 09:43:37
I don't know either, but it was in all call sites
adamk
2016/09/09 17:21:06
Those if statements go back to 2009, and my readin
nickie
2016/09/10 17:41:04
Done. I removed InitializeLoop and added a dummy
|
| + return loop; |
| + } |
| FunctionLiteral* ParseFunctionLiteral( |
| const AstRawString* name, Scanner::Location function_name_location, |
| @@ -938,6 +939,11 @@ class Parser : public ParserBase<Parser> { |
| ZoneList<Expression*>* args, int pos, |
| bool* ok); |
| + V8_INLINE Statement* NewThrowStatement(Expression* exception, int pos) { |
| + return factory()->NewExpressionStatement( |
| + factory()->NewThrow(exception, pos), pos); |
| + } |
| + |
| V8_INLINE void AddParameterInitializationBlock( |
| const ParserFormalParameters& parameters, ZoneList<Statement*>* body, |
| bool is_async, bool* ok) { |