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

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

Issue 2703563002: [ESNext] Implement DynamicImportCall (Closed)
Patch Set: fix build Created 3 years, 9 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 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 3330 matching lines...) Expand 10 before | Expand all | Expand 10 after
3341 3341
3342 template <typename Impl> 3342 template <typename Impl>
3343 typename ParserBase<Impl>::ExpressionT 3343 typename ParserBase<Impl>::ExpressionT
3344 ParserBase<Impl>::ParseDynamicImportExpression(bool* ok) { 3344 ParserBase<Impl>::ParseDynamicImportExpression(bool* ok) {
3345 DCHECK(allow_harmony_dynamic_import()); 3345 DCHECK(allow_harmony_dynamic_import());
3346 Consume(Token::IMPORT); 3346 Consume(Token::IMPORT);
3347 int pos = position(); 3347 int pos = position();
3348 Expect(Token::LPAREN, CHECK_OK); 3348 Expect(Token::LPAREN, CHECK_OK);
3349 ExpressionT arg = ParseAssignmentExpression(true, CHECK_OK); 3349 ExpressionT arg = ParseAssignmentExpression(true, CHECK_OK);
3350 Expect(Token::RPAREN, CHECK_OK); 3350 Expect(Token::RPAREN, CHECK_OK);
3351 ZoneList<ExpressionT>* args = new (zone()) ZoneList<ExpressionT>(1, zone()); 3351 return factory()->NewImportCallExpression(arg, pos);
3352 args->Add(arg, zone());
3353 return factory()->NewCallRuntime(Runtime::kDynamicImportCall, args, pos);
3354 } 3352 }
3355 3353
3356 template <typename Impl> 3354 template <typename Impl>
3357 typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParseSuperExpression( 3355 typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParseSuperExpression(
3358 bool is_new, bool* ok) { 3356 bool is_new, bool* ok) {
3359 Expect(Token::SUPER, CHECK_OK); 3357 Expect(Token::SUPER, CHECK_OK);
3360 int pos = position(); 3358 int pos = position();
3361 3359
3362 DeclarationScope* scope = GetReceiverScope(); 3360 DeclarationScope* scope = GetReceiverScope();
3363 FunctionKind kind = scope->function_kind(); 3361 FunctionKind kind = scope->function_kind();
(...skipping 2442 matching lines...) Expand 10 before | Expand all | Expand 10 after
5806 } 5804 }
5807 5805
5808 #undef CHECK_OK 5806 #undef CHECK_OK
5809 #undef CHECK_OK_CUSTOM 5807 #undef CHECK_OK_CUSTOM
5810 #undef CHECK_OK_VOID 5808 #undef CHECK_OK_VOID
5811 5809
5812 } // namespace internal 5810 } // namespace internal
5813 } // namespace v8 5811 } // namespace v8
5814 5812
5815 #endif // V8_PARSING_PARSER_BASE_H 5813 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698