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

Side by Side Diff: src/parser.cc

Issue 1127063003: [es6] implement default parameters via desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: arv's comments Created 5 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/parser.h ('k') | src/preparser.h » ('j') | src/preparser.h » ('J')
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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 set_allow_harmony_arrow_functions(FLAG_harmony_arrow_functions); 869 set_allow_harmony_arrow_functions(FLAG_harmony_arrow_functions);
870 set_allow_harmony_classes(FLAG_harmony_classes); 870 set_allow_harmony_classes(FLAG_harmony_classes);
871 set_allow_harmony_object_literals(FLAG_harmony_object_literals); 871 set_allow_harmony_object_literals(FLAG_harmony_object_literals);
872 set_allow_harmony_sloppy(FLAG_harmony_sloppy); 872 set_allow_harmony_sloppy(FLAG_harmony_sloppy);
873 set_allow_harmony_unicode(FLAG_harmony_unicode); 873 set_allow_harmony_unicode(FLAG_harmony_unicode);
874 set_allow_harmony_computed_property_names( 874 set_allow_harmony_computed_property_names(
875 FLAG_harmony_computed_property_names); 875 FLAG_harmony_computed_property_names);
876 set_allow_harmony_rest_params(FLAG_harmony_rest_parameters); 876 set_allow_harmony_rest_params(FLAG_harmony_rest_parameters);
877 set_allow_harmony_spreadcalls(FLAG_harmony_spreadcalls); 877 set_allow_harmony_spreadcalls(FLAG_harmony_spreadcalls);
878 set_allow_harmony_destructuring(FLAG_harmony_destructuring); 878 set_allow_harmony_destructuring(FLAG_harmony_destructuring);
879 set_allow_harmony_optional_params(FLAG_harmony_optional_params);
879 set_allow_strong_mode(FLAG_strong_mode); 880 set_allow_strong_mode(FLAG_strong_mode);
880 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; 881 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount;
881 ++feature) { 882 ++feature) {
882 use_counts_[feature] = 0; 883 use_counts_[feature] = 0;
883 } 884 }
884 if (info->ast_value_factory() == NULL) { 885 if (info->ast_value_factory() == NULL) {
885 // info takes ownership of AstValueFactory. 886 // info takes ownership of AstValueFactory.
886 info->set_ast_value_factory(new AstValueFactory(zone(), info->hash_seed())); 887 info->set_ast_value_factory(new AstValueFactory(zone(), info->hash_seed()));
887 info->set_ast_value_factory_owned(); 888 info->set_ast_value_factory_owned();
888 ast_value_factory_ = info->ast_value_factory(); 889 ast_value_factory_ = info->ast_value_factory();
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 ? FunctionLiteral::ANONYMOUS_EXPRESSION 1133 ? FunctionLiteral::ANONYMOUS_EXPRESSION
1133 : FunctionLiteral::NAMED_EXPRESSION) 1134 : FunctionLiteral::NAMED_EXPRESSION)
1134 : FunctionLiteral::DECLARATION; 1135 : FunctionLiteral::DECLARATION;
1135 bool ok = true; 1136 bool ok = true;
1136 1137
1137 if (shared_info->is_arrow()) { 1138 if (shared_info->is_arrow()) {
1138 Scope* scope = NewScope(scope_, ARROW_SCOPE); 1139 Scope* scope = NewScope(scope_, ARROW_SCOPE);
1139 scope->set_start_position(shared_info->start_position()); 1140 scope->set_start_position(shared_info->start_position());
1140 FormalParameterErrorLocations error_locs; 1141 FormalParameterErrorLocations error_locs;
1141 bool has_rest = false; 1142 bool has_rest = false;
1143 bool has_initializers = false;
1144 ZoneList<Expression*>* initializers =
1145 new (zone()) ZoneList<Expression*>(0, zone());
1142 if (Check(Token::LPAREN)) { 1146 if (Check(Token::LPAREN)) {
1143 // '(' StrictFormalParameters ')' 1147 // '(' StrictFormalParameters ')'
1144 ParseFormalParameterList(scope, &error_locs, &has_rest, &ok); 1148 ParseFormalParameterList(scope, &error_locs, initializers,
1149 &has_initializers, &has_rest, &ok);
1145 if (ok) ok = Check(Token::RPAREN); 1150 if (ok) ok = Check(Token::RPAREN);
1146 } else { 1151 } else {
1147 // BindingIdentifier 1152 // BindingIdentifier
1148 ParseFormalParameter(scope, &error_locs, has_rest, &ok); 1153 ParseFormalParameter(scope, &error_locs, nullptr, nullptr, has_rest,
wingo 2015/05/11 15:00:48 nit: would be easier to read with named variables
caitp (gmail) 2015/05/11 15:34:24 Acknowledged.
1154 &ok);
1149 } 1155 }
1150 1156
1151 if (ok) { 1157 if (ok) {
1152 ExpressionClassifier classifier; 1158 ExpressionClassifier classifier;
1153 Expression* expression = ParseArrowFunctionLiteral( 1159 Expression* expression = ParseArrowFunctionLiteral(
1154 scope, error_locs, has_rest, &classifier, &ok); 1160 scope, error_locs, has_rest, &classifier, &ok);
1155 ValidateExpression(&classifier, &ok); 1161 ValidateExpression(&classifier, &ok);
1156 if (ok) { 1162 if (ok) {
1157 // Scanning must end at the same position that was recorded 1163 // Scanning must end at the same position that was recorded
1158 // previously. If not, parsing has been interrupted due to a stack 1164 // previously. If not, parsing has been interrupted due to a stack
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 // initialization code. Thus, inside the 'with' statement, we need 2068 // initialization code. Thus, inside the 'with' statement, we need
2063 // both access to the static and the dynamic context chain; the 2069 // both access to the static and the dynamic context chain; the
2064 // runtime needs to provide both. 2070 // runtime needs to provide both.
2065 if (resolve && var != NULL) { 2071 if (resolve && var != NULL) {
2066 proxy->BindTo(var); 2072 proxy->BindTo(var);
2067 } 2073 }
2068 return var; 2074 return var;
2069 } 2075 }
2070 2076
2071 2077
2078 void Parser::ShadowParametersForExpressions(Scope* scope) {
2079 scope->ShadowParametersForExpressions();
2080 }
2081
2082
2072 // Language extension which is only enabled for source files loaded 2083 // Language extension which is only enabled for source files loaded
2073 // through the API's extension mechanism. A native function 2084 // through the API's extension mechanism. A native function
2074 // declaration is resolved by looking up the function through a 2085 // declaration is resolved by looking up the function through a
2075 // callback provided by the extension. 2086 // callback provided by the extension.
2076 Statement* Parser::ParseNativeDeclaration(bool* ok) { 2087 Statement* Parser::ParseNativeDeclaration(bool* ok) {
2077 int pos = peek_position(); 2088 int pos = peek_position();
2078 Expect(Token::FUNCTION, CHECK_OK); 2089 Expect(Token::FUNCTION, CHECK_OK);
2079 // Allow "eval" or "arguments" for backward compatibility. 2090 // Allow "eval" or "arguments" for backward compatibility.
2080 const AstRawString* name = 2091 const AstRawString* name =
2081 ParseIdentifier(kAllowRestrictedIdentifiers, CHECK_OK); 2092 ParseIdentifier(kAllowRestrictedIdentifiers, CHECK_OK);
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after
3520 3531
3521 inner_scope->set_end_position(scanner()->location().end_pos); 3532 inner_scope->set_end_position(scanner()->location().end_pos);
3522 inner_block->set_scope(inner_scope); 3533 inner_block->set_scope(inner_scope);
3523 scope_ = for_scope; 3534 scope_ = for_scope;
3524 3535
3525 outer_loop->Initialize(NULL, NULL, NULL, inner_block); 3536 outer_loop->Initialize(NULL, NULL, NULL, inner_block);
3526 return outer_block; 3537 return outer_block;
3527 } 3538 }
3528 3539
3529 3540
3541 ZoneList<Statement*>* Parser::DesugarInitializeParameters(
3542 Scope* scope, bool has_initializers, ZoneList<Expression*>* initializers) {
3543 DCHECK(scope->is_function_scope());
3544
3545 if (has_initializers) {
3546 // If hasParameterExpressions for the function is true, each parameter is
wingo 2015/05/11 15:00:48 has_initializers I guess? I know hasParameterExpr
caitp (gmail) 2015/05/11 15:34:24 HasParameterExpressions is also true for Object bi
3547 // desugared as follows:
3548 //
3549 // SingleNameBinding :
3550 // let <name> = %_Arguments(<index>);
3551 // SingleNameBinding Initializer
3552 // let <name> = IS_UNDEFINED(%_Arguments(<index>)) ? <initializer>
3553 // : %_Arguments(<index>);
3554 //
3555 // TODO(caitp, dslomov): support BindingPatterns & rest parameters
3556 //
3557
3558 ShadowParametersForExpressions(scope);
3559 ZoneList<Statement*>* body = new (zone()) ZoneList<Statement*>(0, zone());
3560 for (int i = 0; i < initializers->length(); ++i) {
3561 Expression* initializer = initializers->at(i);
3562
3563 // Position of parameter VariableProxy, for hole-checking
3564 int pos = scope->parameter_position(i);
3565
3566 // Lexically declare the initialized variable
3567 static const VariableMode mode = LET;
3568 VariableProxy* proxy =
3569 NewUnresolved(scope->parameter(i)->raw_name(), mode);
3570 VariableDeclaration* declaration = factory()->NewVariableDeclaration(
3571 proxy, mode, scope, RelocInfo::kNoPosition);
3572 bool ok = true;
3573 proxy = factory()->NewVariableProxy(Declare(declaration, true, &ok), pos);
3574 DCHECK(ok);
wingo 2015/05/11 15:00:48 Seems that Declare can only fail for a var redecla
caitp (gmail) 2015/05/11 15:34:24 Acknowledged.
3575 proxy->var()->set_maybe_assigned();
3576
3577 const AstRawString* fn_name = ast_value_factory()->empty_string();
3578 const Runtime::Function* arguments =
3579 Runtime::FunctionForId(Runtime::kInlineArguments);
3580 ZoneList<Expression*>* arguments_i0 =
3581 new (zone()) ZoneList<Expression*>(0, zone());
3582 arguments_i0->Add(factory()->NewSmiLiteral(i, RelocInfo::kNoPosition),
3583 zone());
3584
3585 // TODO(caitp): ensure proper TDZ behaviour --- need hole-check for
3586 // all parameter bindings, including ones without initializers
3587 if (initializer) {
3588 // IS_UNDEFINED(%_Arguments(i)) ? <initializer> : %_Arguments(i);
3589 ZoneList<Expression*>* arguments_i1 =
3590 new (zone()) ZoneList<Expression*>(0, zone());
3591 arguments_i1->Add(factory()->NewSmiLiteral(i, RelocInfo::kNoPosition),
3592 zone());
3593
3594 Expression* arg_or_default = factory()->NewConditional(
3595 // condition:
3596 factory()->NewCompareOperation(
3597 Token::EQ_STRICT,
3598 factory()->NewCallRuntime(fn_name, arguments, arguments_i0,
3599 RelocInfo::kNoPosition),
3600 factory()->NewUndefinedLiteral(RelocInfo::kNoPosition),
3601 RelocInfo::kNoPosition),
3602 // if true:
3603 initializer,
3604 // if false:
3605 factory()->NewCallRuntime(fn_name, arguments, arguments_i1,
3606 RelocInfo::kNoPosition),
3607 RelocInfo::kNoPosition);
3608
3609 Expression* assign = factory()->NewAssignment(
3610 Token::INIT_LET, proxy, arg_or_default, RelocInfo::kNoPosition);
3611
3612 body->Add(
3613 factory()->NewExpressionStatement(assign, RelocInfo::kNoPosition),
3614 zone());
3615 proxy->var()->set_initializer_position(initializer->position());
3616 } else {
3617 // let <name> = %_Arguments(i)
3618 Expression* assign = factory()->NewAssignment(
3619 Token::INIT_LET, proxy,
3620 factory()->NewCallRuntime(fn_name, arguments, arguments_i0,
3621 RelocInfo::kNoPosition),
3622 RelocInfo::kNoPosition);
3623 body->Add(
3624 factory()->NewExpressionStatement(assign, RelocInfo::kNoPosition),
3625 zone());
3626 proxy->var()->set_initializer_position(pos);
3627 }
3628 }
3629 return body;
3630 } else {
3631 // If hasParameterExpressions is false, remove the unnecessary parameter
3632 // block scopes.
3633 ZoneList<Scope*>* scopes = scope->inner_scopes();
3634 for (int i = 0; i < scopes->length(); ++i) {
3635 Scope* scope = scopes->at(i);
3636 DCHECK(scope->is_block_scope());
3637 scope->FinalizeBlockScope();
3638 }
3639 return nullptr;
3640 }
3641 }
3642
3643
3530 Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels, 3644 Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
3531 bool* ok) { 3645 bool* ok) {
3532 // ForStatement :: 3646 // ForStatement ::
3533 // 'for' '(' Expression? ';' Expression? ';' Expression? ')' Statement 3647 // 'for' '(' Expression? ';' Expression? ';' Expression? ')' Statement
3534 3648
3535 int stmt_pos = peek_position(); 3649 int stmt_pos = peek_position();
3536 bool is_const = false; 3650 bool is_const = false;
3537 Statement* init = NULL; 3651 Statement* init = NULL;
3538 ZoneList<const AstRawString*> lexical_bindings(1, zone()); 3652 ZoneList<const AstRawString*> lexical_bindings(1, zone());
3539 3653
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
3930 error_locs->reserved = param_location; 4044 error_locs->reserved = param_location;
3931 if (!error_locs->undefined.IsValid() && IsUndefined(raw_name)) 4045 if (!error_locs->undefined.IsValid() && IsUndefined(raw_name))
3932 error_locs->undefined = param_location; 4046 error_locs->undefined = param_location;
3933 4047
3934 // When the formal parameter was originally seen, it was parsed as a 4048 // When the formal parameter was originally seen, it was parsed as a
3935 // VariableProxy and recorded as unresolved in the scope. Here we undo that 4049 // VariableProxy and recorded as unresolved in the scope. Here we undo that
3936 // parse-time side-effect. 4050 // parse-time side-effect.
3937 parser_->scope_->RemoveUnresolved(expr->AsVariableProxy()); 4051 parser_->scope_->RemoveUnresolved(expr->AsVariableProxy());
3938 4052
3939 bool is_rest = false; 4053 bool is_rest = false;
3940 bool is_duplicate = DeclareFormalParameter(scope, raw_name, is_rest); 4054 int pos = expr->position();
4055 bool is_duplicate = DeclareFormalParameter(scope, raw_name, is_rest, pos);
3941 4056
3942 if (is_duplicate) { 4057 if (is_duplicate) {
3943 // Arrow function parameter lists are parsed as StrictFormalParameters, 4058 // Arrow function parameter lists are parsed as StrictFormalParameters,
3944 // which means that they cannot have duplicates. Note that this is a subset 4059 // which means that they cannot have duplicates. Note that this is a subset
3945 // of the restrictions placed on parameters to functions whose body is 4060 // of the restrictions placed on parameters to functions whose body is
3946 // strict. 4061 // strict.
3947 ReportMessageAt(param_location, 4062 ReportMessageAt(param_location,
3948 "duplicate_arrow_function_formal_parameter"); 4063 "duplicate_arrow_function_formal_parameter");
3949 *ok = false; 4064 *ok = false;
3950 return; 4065 return;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
4060 // expressions. This also marks the FunctionState as a generator. 4175 // expressions. This also marks the FunctionState as a generator.
4061 Variable* temp = scope_->DeclarationScope()->NewTemporary( 4176 Variable* temp = scope_->DeclarationScope()->NewTemporary(
4062 ast_value_factory()->dot_generator_object_string()); 4177 ast_value_factory()->dot_generator_object_string());
4063 function_state.set_generator_object_variable(temp); 4178 function_state.set_generator_object_variable(temp);
4064 } 4179 }
4065 4180
4066 bool has_rest = false; 4181 bool has_rest = false;
4067 Expect(Token::LPAREN, CHECK_OK); 4182 Expect(Token::LPAREN, CHECK_OK);
4068 int start_position = scanner()->location().beg_pos; 4183 int start_position = scanner()->location().beg_pos;
4069 scope_->set_start_position(start_position); 4184 scope_->set_start_position(start_position);
4185 ZoneList<Expression*>* initializers =
4186 new (zone()) ZoneList<Expression*>(0, zone());
4187 bool has_initializers = false;
4070 num_parameters = 4188 num_parameters =
4071 ParseFormalParameterList(scope, &error_locs, &has_rest, CHECK_OK); 4189 ParseFormalParameterList(scope, &error_locs, initializers,
4190 &has_initializers, &has_rest, CHECK_OK);
4072 Expect(Token::RPAREN, CHECK_OK); 4191 Expect(Token::RPAREN, CHECK_OK);
4073 int formals_end_position = scanner()->location().end_pos; 4192 int formals_end_position = scanner()->location().end_pos;
4074 4193
4075 CheckArityRestrictions(num_parameters, arity_restriction, start_position, 4194 CheckArityRestrictions(num_parameters, arity_restriction, start_position,
4076 formals_end_position, CHECK_OK); 4195 formals_end_position, CHECK_OK);
4077 4196
4078 Expect(Token::LBRACE, CHECK_OK); 4197 Expect(Token::LBRACE, CHECK_OK);
4079 4198
4080 // If we have a named function expression, we add a local variable 4199 // If we have a named function expression, we add a local variable
4081 // declaration to the body of the function with the name of the 4200 // declaration to the body of the function with the name of the
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
4162 is_lazily_parsed = false; 4281 is_lazily_parsed = false;
4163 4282
4164 // This is probably an initialization function. Inform the compiler it 4283 // This is probably an initialization function. Inform the compiler it
4165 // should also eager-compile this function, and that we expect it to be 4284 // should also eager-compile this function, and that we expect it to be
4166 // used once. 4285 // used once.
4167 eager_compile_hint = FunctionLiteral::kShouldEagerCompile; 4286 eager_compile_hint = FunctionLiteral::kShouldEagerCompile;
4168 should_be_used_once_hint = true; 4287 should_be_used_once_hint = true;
4169 } 4288 }
4170 } 4289 }
4171 if (!is_lazily_parsed) { 4290 if (!is_lazily_parsed) {
4172 body = ParseEagerFunctionBody(function_name, pos, fvar, fvar_init_op, 4291 body = DesugarInitializeParameters(scope, has_initializers, initializers);
4173 kind, CHECK_OK); 4292 if (has_initializers) {
4293 // TODO(caitp): Function body scope must be a declaration scope
4294 Scope* function_body_scope = NewScope(scope, BLOCK_SCOPE);
4295 function_body_scope->set_start_position(scope->start_position());
4296 function_body_scope->SetScopeName(function_name);
4297 BlockState function_body_state(&scope_, function_body_scope);
4298 ZoneList<Statement*>* inner_body = ParseEagerFunctionBody(
4299 function_name, pos, fvar, fvar_init_op, kind, CHECK_OK);
4300 scope->set_end_position(function_body_scope->end_position());
4301 body->AddAll(*inner_body, zone());
4302 } else {
4303 body = ParseEagerFunctionBody(function_name, pos, fvar, fvar_init_op,
4304 kind, CHECK_OK);
4305 }
4174 materialized_literal_count = function_state.materialized_literal_count(); 4306 materialized_literal_count = function_state.materialized_literal_count();
4175 expected_property_count = function_state.expected_property_count(); 4307 expected_property_count = function_state.expected_property_count();
4176 handler_count = function_state.handler_count(); 4308 handler_count = function_state.handler_count();
4177 4309
4178 if (is_strong(language_mode()) && IsSubclassConstructor(kind)) { 4310 if (is_strong(language_mode()) && IsSubclassConstructor(kind)) {
4179 if (!function_state.super_location().IsValid()) { 4311 if (!function_state.super_location().IsValid()) {
4180 ReportMessageAt(function_name_location, 4312 ReportMessageAt(function_name_location,
4181 "strong_super_call_missing", kReferenceError); 4313 "strong_super_call_missing", kReferenceError);
4182 *ok = false; 4314 *ok = false;
4183 return nullptr; 4315 return nullptr;
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
4414 reusable_preparser_->set_allow_harmony_sloppy(allow_harmony_sloppy()); 4546 reusable_preparser_->set_allow_harmony_sloppy(allow_harmony_sloppy());
4415 reusable_preparser_->set_allow_harmony_unicode(allow_harmony_unicode()); 4547 reusable_preparser_->set_allow_harmony_unicode(allow_harmony_unicode());
4416 reusable_preparser_->set_allow_harmony_computed_property_names( 4548 reusable_preparser_->set_allow_harmony_computed_property_names(
4417 allow_harmony_computed_property_names()); 4549 allow_harmony_computed_property_names());
4418 reusable_preparser_->set_allow_harmony_rest_params( 4550 reusable_preparser_->set_allow_harmony_rest_params(
4419 allow_harmony_rest_params()); 4551 allow_harmony_rest_params());
4420 reusable_preparser_->set_allow_harmony_spreadcalls( 4552 reusable_preparser_->set_allow_harmony_spreadcalls(
4421 allow_harmony_spreadcalls()); 4553 allow_harmony_spreadcalls());
4422 reusable_preparser_->set_allow_harmony_destructuring( 4554 reusable_preparser_->set_allow_harmony_destructuring(
4423 allow_harmony_destructuring()); 4555 allow_harmony_destructuring());
4556 reusable_preparser_->set_allow_harmony_optional_params(
4557 allow_harmony_optional_params());
4424 reusable_preparser_->set_allow_strong_mode(allow_strong_mode()); 4558 reusable_preparser_->set_allow_strong_mode(allow_strong_mode());
4425 } 4559 }
4426 PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction( 4560 PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction(
4427 language_mode(), function_state_->kind(), logger, bookmark); 4561 language_mode(), function_state_->kind(), logger, bookmark);
4428 if (pre_parse_timer_ != NULL) { 4562 if (pre_parse_timer_ != NULL) {
4429 pre_parse_timer_->Stop(); 4563 pre_parse_timer_->Stop();
4430 } 4564 }
4431 return result; 4565 return result;
4432 } 4566 }
4433 4567
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
5925 6059
5926 Expression* Parser::SpreadCallNew(Expression* function, 6060 Expression* Parser::SpreadCallNew(Expression* function,
5927 ZoneList<v8::internal::Expression*>* args, 6061 ZoneList<v8::internal::Expression*>* args,
5928 int pos) { 6062 int pos) {
5929 args->InsertAt(0, function, zone()); 6063 args->InsertAt(0, function, zone());
5930 6064
5931 return factory()->NewCallRuntime( 6065 return factory()->NewCallRuntime(
5932 ast_value_factory()->reflect_construct_string(), NULL, args, pos); 6066 ast_value_factory()->reflect_construct_string(), NULL, args, pos);
5933 } 6067 }
5934 } } // namespace v8::internal 6068 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698