| 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 // Checking the parameter names of a function literal. This has to be done | 468 // Checking the parameter names of a function literal. This has to be done |
| 469 // after parsing the function, since the function can declare itself strict. | 469 // after parsing the function, since the function can declare itself strict. |
| 470 void CheckFunctionParameterNames(LanguageMode language_mode, | 470 void CheckFunctionParameterNames(LanguageMode language_mode, |
| 471 bool strict_params, | 471 bool strict_params, |
| 472 const Scanner::Location& eval_args_error_loc, | 472 const Scanner::Location& eval_args_error_loc, |
| 473 const Scanner::Location& dupe_error_loc, | 473 const Scanner::Location& dupe_error_loc, |
| 474 const Scanner::Location& reserved_loc, | 474 const Scanner::Location& reserved_loc, |
| 475 bool* ok) { | 475 bool* ok) { |
| 476 if (is_sloppy(language_mode) && !strict_params) return; | 476 if (is_sloppy(language_mode) && !strict_params) return; |
| 477 | 477 |
| 478 if (eval_args_error_loc.IsValid()) { | 478 if (is_strict(language_mode) && eval_args_error_loc.IsValid()) { |
| 479 Traits::ReportMessageAt(eval_args_error_loc, "strict_eval_arguments"); | 479 Traits::ReportMessageAt(eval_args_error_loc, "strict_eval_arguments"); |
| 480 *ok = false; | 480 *ok = false; |
| 481 return; | 481 return; |
| 482 } | 482 } |
| 483 // TODO(arv): When we add support for destructuring in setters we also need | 483 // TODO(arv): When we add support for destructuring in setters we also need |
| 484 // to check for duplicate names. | 484 // to check for duplicate names. |
| 485 if (dupe_error_loc.IsValid()) { | 485 if (dupe_error_loc.IsValid()) { |
| 486 Traits::ReportMessageAt(dupe_error_loc, "strict_param_dupe"); | 486 Traits::ReportMessageAt(dupe_error_loc, "strict_param_dupe"); |
| 487 *ok = false; | 487 *ok = false; |
| 488 return; | 488 return; |
| (...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3076 *ok = false; | 3076 *ok = false; |
| 3077 return; | 3077 return; |
| 3078 } | 3078 } |
| 3079 has_seen_constructor_ = true; | 3079 has_seen_constructor_ = true; |
| 3080 return; | 3080 return; |
| 3081 } | 3081 } |
| 3082 } | 3082 } |
| 3083 } } // v8::internal | 3083 } } // v8::internal |
| 3084 | 3084 |
| 3085 #endif // V8_PREPARSER_H | 3085 #endif // V8_PREPARSER_H |
| OLD | NEW |