Chromium Code Reviews| Index: src/preparser.cc |
| diff --git a/src/preparser.cc b/src/preparser.cc |
| index ecf4a950c0ea8e76192e205020de4713bafb5f40..74e11b1d454b3b33a3f6bcadb18f91476a246f37 100644 |
| --- a/src/preparser.cc |
| +++ b/src/preparser.cc |
| @@ -1239,6 +1239,23 @@ PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) { |
| return Expression::Default(); |
| } |
| + |
| +PreParserExpression PreParser::ParseDoExpression(bool* ok) { |
| + // AssignmentExpression :: |
| + // do '{' StatementList '}' |
| + Expect(Token::DO, CHECK_OK); |
| + Expect(Token::LBRACE, CHECK_OK); |
| + Scope* block_scope = NewScope(scope_, BLOCK_SCOPE); |
|
adamk
2015/10/15 10:59:33
Why does this need a Scope when we don't use a Sco
caitp (gmail)
2015/10/15 11:24:17
Allocating the temporary result, but it lives in t
adamk
2015/10/15 12:01:25
I'd remove it (and maybe just delegate to ParseBlo
caitp (gmail)
2015/10/15 12:34:07
Wait, I had actually gotten rid of this in an earl
|
| + { |
| + BlockState block_state(&scope_, block_scope); |
| + while (peek() != Token::RBRACE) { |
| + ParseStatementListItem(CHECK_OK); |
| + } |
| + Expect(Token::RBRACE, CHECK_OK); |
| + return PreParserExpression::Default(); |
| + } |
| +} |
| + |
| #undef CHECK_OK |