| 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_PREPARSER_H | 5 #ifndef V8_PREPARSER_H |
| 6 #define V8_PREPARSER_H | 6 #define V8_PREPARSER_H |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
| (...skipping 3752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3763 // that duplicates are not allowed. Of course, the arrow function may | 3763 // that duplicates are not allowed. Of course, the arrow function may |
| 3764 // itself be strict as well. | 3764 // itself be strict as well. |
| 3765 const bool allow_duplicate_parameters = false; | 3765 const bool allow_duplicate_parameters = false; |
| 3766 this->ValidateFormalParameters(&formals_classifier, language_mode(), | 3766 this->ValidateFormalParameters(&formals_classifier, language_mode(), |
| 3767 allow_duplicate_parameters, CHECK_OK); | 3767 allow_duplicate_parameters, CHECK_OK); |
| 3768 | 3768 |
| 3769 // Validate strict mode. | 3769 // Validate strict mode. |
| 3770 if (is_strict(language_mode())) { | 3770 if (is_strict(language_mode())) { |
| 3771 CheckStrictOctalLiteral(formal_parameters.scope->start_position(), | 3771 CheckStrictOctalLiteral(formal_parameters.scope->start_position(), |
| 3772 scanner()->location().end_pos, CHECK_OK); | 3772 scanner()->location().end_pos, CHECK_OK); |
| 3773 } |
| 3774 if (is_strict(language_mode()) || allow_harmony_sloppy()) { |
| 3773 this->CheckConflictingVarDeclarations(formal_parameters.scope, CHECK_OK); | 3775 this->CheckConflictingVarDeclarations(formal_parameters.scope, CHECK_OK); |
| 3774 } | 3776 } |
| 3775 } | 3777 } |
| 3776 | 3778 |
| 3777 FunctionLiteralT function_literal = factory()->NewFunctionLiteral( | 3779 FunctionLiteralT function_literal = factory()->NewFunctionLiteral( |
| 3778 this->EmptyIdentifierString(), ast_value_factory(), | 3780 this->EmptyIdentifierString(), ast_value_factory(), |
| 3779 formal_parameters.scope, body, materialized_literal_count, | 3781 formal_parameters.scope, body, materialized_literal_count, |
| 3780 expected_property_count, num_parameters, | 3782 expected_property_count, num_parameters, |
| 3781 FunctionLiteral::kNoDuplicateParameters, | 3783 FunctionLiteral::kNoDuplicateParameters, |
| 3782 FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction, | 3784 FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction, |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3978 *ok = false; | 3980 *ok = false; |
| 3979 return; | 3981 return; |
| 3980 } | 3982 } |
| 3981 has_seen_constructor_ = true; | 3983 has_seen_constructor_ = true; |
| 3982 return; | 3984 return; |
| 3983 } | 3985 } |
| 3984 } | 3986 } |
| 3985 } } // v8::internal | 3987 } } // v8::internal |
| 3986 | 3988 |
| 3987 #endif // V8_PREPARSER_H | 3989 #endif // V8_PREPARSER_H |
| OLD | NEW |