Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: src/parsing/preparser.cc

Issue 1895603002: [esnext] prototype runtime implementation for async functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AsyncFunction
Patch Set: fix some nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/parsing/preparser.h ('k') | src/runtime/runtime-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 // do '{' StatementList '}' 1286 // do '{' StatementList '}'
1287 Expect(Token::DO, CHECK_OK); 1287 Expect(Token::DO, CHECK_OK);
1288 Expect(Token::LBRACE, CHECK_OK); 1288 Expect(Token::LBRACE, CHECK_OK);
1289 while (peek() != Token::RBRACE) { 1289 while (peek() != Token::RBRACE) {
1290 ParseStatementListItem(CHECK_OK); 1290 ParseStatementListItem(CHECK_OK);
1291 } 1291 }
1292 Expect(Token::RBRACE, CHECK_OK); 1292 Expect(Token::RBRACE, CHECK_OK);
1293 return PreParserExpression::Default(); 1293 return PreParserExpression::Default();
1294 } 1294 }
1295 1295
1296 void PreParserTraits::ParseAsyncArrowSingleExpressionBody(
1297 PreParserStatementList body, bool accept_IN,
1298 Type::ExpressionClassifier* classifier, int pos, bool* ok) {
1299 Scope* scope = pre_parser_->scope_;
1300 scope->ForceContextAllocation();
1301
1302 PreParserExpression return_value =
1303 pre_parser_->ParseAssignmentExpression(accept_IN, classifier, ok);
1304 if (!*ok) return;
1305
1306 body->Add(PreParserStatement::ExpressionStatement(return_value), zone());
1307 }
1308
1296 #undef CHECK_OK 1309 #undef CHECK_OK
1297 1310
1298 1311
1299 } // namespace internal 1312 } // namespace internal
1300 } // namespace v8 1313 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/preparser.h ('k') | src/runtime/runtime-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698