OLD | NEW |
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/ast-literal-reindexer.h" | 9 #include "src/ast-literal-reindexer.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 3908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3919 | 3919 |
3920 for (int i = 0; i < parameters->Arity(); ++i) { | 3920 for (int i = 0; i < parameters->Arity(); ++i) { |
3921 auto parameter = parameters->at(i); | 3921 auto parameter = parameters->at(i); |
3922 ExpressionClassifier classifier; | 3922 ExpressionClassifier classifier; |
3923 DeclareFormalParameter( | 3923 DeclareFormalParameter( |
3924 parameters->scope, parameter, parameters->is_simple, &classifier); | 3924 parameters->scope, parameter, parameters->is_simple, &classifier); |
3925 if (!duplicate_loc->IsValid()) { | 3925 if (!duplicate_loc->IsValid()) { |
3926 *duplicate_loc = classifier.duplicate_formal_parameter_error().location; | 3926 *duplicate_loc = classifier.duplicate_formal_parameter_error().location; |
3927 } | 3927 } |
3928 } | 3928 } |
| 3929 DCHECK_EQ(parameters->is_simple, parameters->scope->has_simple_parameters()); |
3929 } | 3930 } |
3930 | 3931 |
3931 | 3932 |
3932 void ParserTraits::ReindexLiterals(const ParserFormalParameters& parameters) { | 3933 void ParserTraits::ReindexLiterals(const ParserFormalParameters& parameters) { |
3933 if (parser_->function_state_->materialized_literal_count() > 0) { | 3934 if (parser_->function_state_->materialized_literal_count() > 0) { |
3934 AstLiteralReindexer reindexer; | 3935 AstLiteralReindexer reindexer; |
3935 | 3936 |
3936 for (const auto p : parameters.params) { | 3937 for (const auto p : parameters.params) { |
3937 if (p.pattern != nullptr) reindexer.Reindex(p.pattern); | 3938 if (p.pattern != nullptr) reindexer.Reindex(p.pattern); |
3938 } | 3939 } |
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6009 Expression* Parser::SpreadCallNew(Expression* function, | 6010 Expression* Parser::SpreadCallNew(Expression* function, |
6010 ZoneList<v8::internal::Expression*>* args, | 6011 ZoneList<v8::internal::Expression*>* args, |
6011 int pos) { | 6012 int pos) { |
6012 args->InsertAt(0, function, zone()); | 6013 args->InsertAt(0, function, zone()); |
6013 | 6014 |
6014 return factory()->NewCallRuntime( | 6015 return factory()->NewCallRuntime( |
6015 ast_value_factory()->reflect_construct_string(), NULL, args, pos); | 6016 ast_value_factory()->reflect_construct_string(), NULL, args, pos); |
6016 } | 6017 } |
6017 } // namespace internal | 6018 } // namespace internal |
6018 } // namespace v8 | 6019 } // namespace v8 |
OLD | NEW |