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/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/ast-expression-visitor.h" | 9 #include "src/ast/ast-expression-visitor.h" |
10 #include "src/ast/ast-literal-reindexer.h" | 10 #include "src/ast/ast-literal-reindexer.h" |
(...skipping 4460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4471 | 4471 |
4472 | 4472 |
4473 Block* Parser::BuildParameterInitializationBlock( | 4473 Block* Parser::BuildParameterInitializationBlock( |
4474 const ParserFormalParameters& parameters, bool* ok) { | 4474 const ParserFormalParameters& parameters, bool* ok) { |
4475 DCHECK(!parameters.is_simple); | 4475 DCHECK(!parameters.is_simple); |
4476 DCHECK(scope_->is_function_scope()); | 4476 DCHECK(scope_->is_function_scope()); |
4477 Block* init_block = | 4477 Block* init_block = |
4478 factory()->NewBlock(NULL, 1, true, RelocInfo::kNoPosition); | 4478 factory()->NewBlock(NULL, 1, true, RelocInfo::kNoPosition); |
4479 for (int i = 0; i < parameters.params.length(); ++i) { | 4479 for (int i = 0; i < parameters.params.length(); ++i) { |
4480 auto parameter = parameters.params[i]; | 4480 auto parameter = parameters.params[i]; |
4481 if (parameter.is_rest) break; | 4481 if (parameter.is_rest && parameter.pattern->IsVariableProxy()) break; |
4482 DeclarationDescriptor descriptor; | 4482 DeclarationDescriptor descriptor; |
4483 descriptor.declaration_kind = DeclarationDescriptor::PARAMETER; | 4483 descriptor.declaration_kind = DeclarationDescriptor::PARAMETER; |
4484 descriptor.parser = this; | 4484 descriptor.parser = this; |
4485 descriptor.scope = scope_; | 4485 descriptor.scope = scope_; |
4486 descriptor.hoist_scope = nullptr; | 4486 descriptor.hoist_scope = nullptr; |
4487 descriptor.mode = LET; | 4487 descriptor.mode = LET; |
4488 descriptor.needs_init = true; | 4488 descriptor.needs_init = true; |
4489 descriptor.declaration_pos = parameter.pattern->position(); | 4489 descriptor.declaration_pos = parameter.pattern->position(); |
4490 // The position that will be used by the AssignmentExpression | 4490 // The position that will be used by the AssignmentExpression |
4491 // which copies from the temp parameter to the pattern. | 4491 // which copies from the temp parameter to the pattern. |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5452 auto class_literal = value->AsClassLiteral(); | 5452 auto class_literal = value->AsClassLiteral(); |
5453 if (class_literal->raw_name() == nullptr) { | 5453 if (class_literal->raw_name() == nullptr) { |
5454 class_literal->set_raw_name(name); | 5454 class_literal->set_raw_name(name); |
5455 } | 5455 } |
5456 } | 5456 } |
5457 } | 5457 } |
5458 | 5458 |
5459 | 5459 |
5460 } // namespace internal | 5460 } // namespace internal |
5461 } // namespace v8 | 5461 } // namespace v8 |
OLD | NEW |