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

Side by Side Diff: src/parsing/parser-base.h

Issue 2703563002: [ESNext] Implement DynamicImportCall (Closed)
Patch Set: rebase Created 3 years, 8 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/objects.h ('k') | src/parsing/pattern-rewriter.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_PARSING_PARSER_BASE_H 5 #ifndef V8_PARSING_PARSER_BASE_H
6 #define V8_PARSING_PARSER_BASE_H 6 #define V8_PARSING_PARSER_BASE_H
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 3436 matching lines...) Expand 10 before | Expand all | Expand 10 after
3447 3447
3448 template <typename Impl> 3448 template <typename Impl>
3449 typename ParserBase<Impl>::ExpressionT 3449 typename ParserBase<Impl>::ExpressionT
3450 ParserBase<Impl>::ParseDynamicImportExpression(bool* ok) { 3450 ParserBase<Impl>::ParseDynamicImportExpression(bool* ok) {
3451 DCHECK(allow_harmony_dynamic_import()); 3451 DCHECK(allow_harmony_dynamic_import());
3452 Consume(Token::IMPORT); 3452 Consume(Token::IMPORT);
3453 int pos = position(); 3453 int pos = position();
3454 Expect(Token::LPAREN, CHECK_OK); 3454 Expect(Token::LPAREN, CHECK_OK);
3455 ExpressionT arg = ParseAssignmentExpression(true, CHECK_OK); 3455 ExpressionT arg = ParseAssignmentExpression(true, CHECK_OK);
3456 Expect(Token::RPAREN, CHECK_OK); 3456 Expect(Token::RPAREN, CHECK_OK);
3457 ZoneList<ExpressionT>* args = new (zone()) ZoneList<ExpressionT>(1, zone()); 3457 return factory()->NewImportCallExpression(arg, pos);
3458 args->Add(arg, zone());
3459 return factory()->NewCallRuntime(Runtime::kDynamicImportCall, args, pos);
3460 } 3458 }
3461 3459
3462 template <typename Impl> 3460 template <typename Impl>
3463 typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParseSuperExpression( 3461 typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParseSuperExpression(
3464 bool is_new, bool* ok) { 3462 bool is_new, bool* ok) {
3465 Expect(Token::SUPER, CHECK_OK); 3463 Expect(Token::SUPER, CHECK_OK);
3466 int pos = position(); 3464 int pos = position();
3467 3465
3468 DeclarationScope* scope = GetReceiverScope(); 3466 DeclarationScope* scope = GetReceiverScope();
3469 FunctionKind kind = scope->function_kind(); 3467 FunctionKind kind = scope->function_kind();
(...skipping 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after
5932 } 5930 }
5933 5931
5934 #undef CHECK_OK 5932 #undef CHECK_OK
5935 #undef CHECK_OK_CUSTOM 5933 #undef CHECK_OK_CUSTOM
5936 #undef CHECK_OK_VOID 5934 #undef CHECK_OK_VOID
5937 5935
5938 } // namespace internal 5936 } // namespace internal
5939 } // namespace v8 5937 } // namespace v8
5940 5938
5941 #endif // V8_PARSING_PARSER_BASE_H 5939 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/parsing/pattern-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698