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

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: Add AsyncFunction constructor 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
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 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« src/bootstrapper.cc ('K') | « src/parsing/preparser.h ('k') | src/profiler/sampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698