| 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_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
| 6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_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/base/compiler-specific.h" | 10 #include "src/base/compiler-specific.h" |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 if (!is_simple) scope->SetHasNonSimpleParameters(); | 1067 if (!is_simple) scope->SetHasNonSimpleParameters(); |
| 1068 bool is_optional = parameter->initializer != nullptr; | 1068 bool is_optional = parameter->initializer != nullptr; |
| 1069 Variable* var = | 1069 Variable* var = |
| 1070 scope->DeclareParameter(name, mode, is_optional, parameter->is_rest, | 1070 scope->DeclareParameter(name, mode, is_optional, parameter->is_rest, |
| 1071 &is_duplicate, ast_value_factory()); | 1071 &is_duplicate, ast_value_factory()); |
| 1072 if (is_duplicate && | 1072 if (is_duplicate && |
| 1073 classifier()->is_valid_formal_parameter_list_without_duplicates()) { | 1073 classifier()->is_valid_formal_parameter_list_without_duplicates()) { |
| 1074 classifier()->RecordDuplicateFormalParameterError( | 1074 classifier()->RecordDuplicateFormalParameterError( |
| 1075 scanner()->location()); | 1075 scanner()->location()); |
| 1076 } | 1076 } |
| 1077 if (is_sloppy(scope->language_mode())) { | |
| 1078 // TODO(sigurds) Mark every parameter as maybe assigned. This is a | |
| 1079 // conservative approximation necessary to account for parameters | |
| 1080 // that are assigned via the arguments array. | |
| 1081 var->set_maybe_assigned(); | |
| 1082 } | |
| 1083 } | 1077 } |
| 1084 } | 1078 } |
| 1085 | 1079 |
| 1086 void DeclareArrowFunctionFormalParameters(ParserFormalParameters* parameters, | 1080 void DeclareArrowFunctionFormalParameters(ParserFormalParameters* parameters, |
| 1087 Expression* params, | 1081 Expression* params, |
| 1088 const Scanner::Location& params_loc, | 1082 const Scanner::Location& params_loc, |
| 1089 Scanner::Location* duplicate_loc, | 1083 Scanner::Location* duplicate_loc, |
| 1090 bool* ok); | 1084 bool* ok); |
| 1091 | 1085 |
| 1092 void ReindexLiterals(const ParserFormalParameters& parameters); | 1086 void ReindexLiterals(const ParserFormalParameters& parameters); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 | 1182 |
| 1189 private: | 1183 private: |
| 1190 ParserTarget** variable_; | 1184 ParserTarget** variable_; |
| 1191 ParserTarget* previous_; | 1185 ParserTarget* previous_; |
| 1192 }; | 1186 }; |
| 1193 | 1187 |
| 1194 } // namespace internal | 1188 } // namespace internal |
| 1195 } // namespace v8 | 1189 } // namespace v8 |
| 1196 | 1190 |
| 1197 #endif // V8_PARSING_PARSER_H_ | 1191 #endif // V8_PARSING_PARSER_H_ |
| OLD | NEW |