OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "src/allocation.h" | 7 #include "src/allocation.h" |
8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
9 #include "src/conversions-inl.h" | 9 #include "src/conversions-inl.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 // do '{' StatementList '}' | 1284 // do '{' StatementList '}' |
1285 Expect(Token::DO, CHECK_OK); | 1285 Expect(Token::DO, CHECK_OK); |
1286 Expect(Token::LBRACE, CHECK_OK); | 1286 Expect(Token::LBRACE, CHECK_OK); |
1287 while (peek() != Token::RBRACE) { | 1287 while (peek() != Token::RBRACE) { |
1288 ParseStatementListItem(CHECK_OK); | 1288 ParseStatementListItem(CHECK_OK); |
1289 } | 1289 } |
1290 Expect(Token::RBRACE, CHECK_OK); | 1290 Expect(Token::RBRACE, CHECK_OK); |
1291 return PreParserExpression::Default(); | 1291 return PreParserExpression::Default(); |
1292 } | 1292 } |
1293 | 1293 |
| 1294 void PreParserTraits::ParseAsyncArrowSingleExpressionBody( |
| 1295 PreParserStatementList body, bool accept_IN, |
| 1296 Type::ExpressionClassifier* classifier, int pos, bool* ok) { |
| 1297 Scope* scope = pre_parser_->scope_; |
| 1298 scope->ForceContextAllocation(); |
| 1299 |
| 1300 PreParserExpression return_value = |
| 1301 pre_parser_->ParseAssignmentExpression(accept_IN, classifier, ok); |
| 1302 if (!*ok) return; |
| 1303 |
| 1304 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); |
| 1305 } |
| 1306 |
1294 #undef CHECK_OK | 1307 #undef CHECK_OK |
1295 | 1308 |
1296 | 1309 |
1297 } // namespace internal | 1310 } // namespace internal |
1298 } // namespace v8 | 1311 } // namespace v8 |
OLD | NEW |