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 #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 4023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4034 // Validate strict mode. | 4034 // Validate strict mode. |
4035 if (is_strict(language_mode())) { | 4035 if (is_strict(language_mode())) { |
4036 CheckStrictOctalLiteral(formal_parameters.scope->start_position(), | 4036 CheckStrictOctalLiteral(formal_parameters.scope->start_position(), |
4037 scanner()->location().end_pos, CHECK_OK); | 4037 scanner()->location().end_pos, CHECK_OK); |
4038 } | 4038 } |
4039 impl()->CheckConflictingVarDeclarations(formal_parameters.scope, CHECK_OK); | 4039 impl()->CheckConflictingVarDeclarations(formal_parameters.scope, CHECK_OK); |
4040 | 4040 |
4041 impl()->RewriteDestructuringAssignments(); | 4041 impl()->RewriteDestructuringAssignments(); |
4042 } | 4042 } |
4043 | 4043 |
| 4044 if (FLAG_trace_preparse) { |
| 4045 Scope* scope = formal_parameters.scope; |
| 4046 PrintF(" [%s]: %i-%i (arrow function)\n", |
| 4047 is_lazy_top_level_function ? "Preparse no-resolution" : "Full parse", |
| 4048 scope->start_position(), scope->end_position()); |
| 4049 } |
4044 FunctionLiteralT function_literal = factory()->NewFunctionLiteral( | 4050 FunctionLiteralT function_literal = factory()->NewFunctionLiteral( |
4045 impl()->EmptyIdentifierString(), formal_parameters.scope, body, | 4051 impl()->EmptyIdentifierString(), formal_parameters.scope, body, |
4046 materialized_literal_count, expected_property_count, | 4052 materialized_literal_count, expected_property_count, |
4047 formal_parameters.num_parameters(), formal_parameters.function_length, | 4053 formal_parameters.num_parameters(), formal_parameters.function_length, |
4048 FunctionLiteral::kNoDuplicateParameters, | 4054 FunctionLiteral::kNoDuplicateParameters, |
4049 FunctionLiteral::kAnonymousExpression, eager_compile_hint, | 4055 FunctionLiteral::kAnonymousExpression, eager_compile_hint, |
4050 formal_parameters.scope->start_position()); | 4056 formal_parameters.scope->start_position()); |
4051 | 4057 |
4052 function_literal->set_function_token_position( | 4058 function_literal->set_function_token_position( |
4053 formal_parameters.scope->start_position()); | 4059 formal_parameters.scope->start_position()); |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5462 has_seen_constructor_ = true; | 5468 has_seen_constructor_ = true; |
5463 return; | 5469 return; |
5464 } | 5470 } |
5465 } | 5471 } |
5466 | 5472 |
5467 | 5473 |
5468 } // namespace internal | 5474 } // namespace internal |
5469 } // namespace v8 | 5475 } // namespace v8 |
5470 | 5476 |
5471 #endif // V8_PARSING_PARSER_BASE_H | 5477 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |