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 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 // do '{' StatementList '}' | 1258 // do '{' StatementList '}' |
1259 Expect(Token::DO, CHECK_OK); | 1259 Expect(Token::DO, CHECK_OK); |
1260 Expect(Token::LBRACE, CHECK_OK); | 1260 Expect(Token::LBRACE, CHECK_OK); |
1261 while (peek() != Token::RBRACE) { | 1261 while (peek() != Token::RBRACE) { |
1262 ParseStatementListItem(CHECK_OK); | 1262 ParseStatementListItem(CHECK_OK); |
1263 } | 1263 } |
1264 Expect(Token::RBRACE, CHECK_OK); | 1264 Expect(Token::RBRACE, CHECK_OK); |
1265 return PreParserExpression::Default(); | 1265 return PreParserExpression::Default(); |
1266 } | 1266 } |
1267 | 1267 |
| 1268 void PreParserTraits::ParseAsyncArrowSingleExpressionBody( |
| 1269 PreParserStatementList body, bool accept_IN, |
| 1270 Type::ExpressionClassifier* classifier, int pos, bool* ok) { |
| 1271 Scope* scope = pre_parser_->scope_; |
| 1272 scope->ForceContextAllocation(); |
| 1273 |
| 1274 PreParserExpression return_value = |
| 1275 pre_parser_->ParseAssignmentExpression(accept_IN, classifier, ok); |
| 1276 if (!*ok) return; |
| 1277 |
| 1278 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); |
| 1279 } |
| 1280 |
1268 #undef CHECK_OK | 1281 #undef CHECK_OK |
1269 | 1282 |
1270 | 1283 |
1271 } // namespace internal | 1284 } // namespace internal |
1272 } // namespace v8 | 1285 } // namespace v8 |
OLD | NEW |