| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 <cmath> | 5 #include <cmath> |
| 6 | 6 |
| 7 #include "src/allocation.h" | 7 #include "src/allocation.h" |
| 8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
| 9 #include "src/conversions-inl.h" | 9 #include "src/conversions-inl.h" |
| 10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 Expect(Token::LBRACE, CHECK_OK_VALUE(kPreParseSuccess)); | 126 Expect(Token::LBRACE, CHECK_OK_VALUE(kPreParseSuccess)); |
| 127 LazyParsingResult result = ParseStatementListAndLogFunction( | 127 LazyParsingResult result = ParseStatementListAndLogFunction( |
| 128 &formals, has_duplicate_parameters, may_abort, ok); | 128 &formals, has_duplicate_parameters, may_abort, ok); |
| 129 use_counts_ = nullptr; | 129 use_counts_ = nullptr; |
| 130 track_unresolved_variables_ = false; | 130 track_unresolved_variables_ = false; |
| 131 if (result == kLazyParsingAborted) { | 131 if (result == kLazyParsingAborted) { |
| 132 return kPreParseAbort; | 132 return kPreParseAbort; |
| 133 } else if (stack_overflow()) { | 133 } else if (stack_overflow()) { |
| 134 return kPreParseStackOverflow; | 134 return kPreParseStackOverflow; |
| 135 } else if (!*ok) { | 135 } else if (!*ok) { |
| 136 DCHECK(log_.has_error()); | 136 DCHECK(pending_error_handler_->has_pending_error()); |
| 137 } else { | 137 } else { |
| 138 DCHECK_EQ(Token::RBRACE, scanner()->peek()); | 138 DCHECK_EQ(Token::RBRACE, scanner()->peek()); |
| 139 | 139 |
| 140 if (!IsArrowFunction(kind)) { | 140 if (!IsArrowFunction(kind)) { |
| 141 // Validate parameter names. We can do this only after parsing the | 141 // Validate parameter names. We can do this only after parsing the |
| 142 // function, since the function can declare itself strict. | 142 // function, since the function can declare itself strict. |
| 143 const bool allow_duplicate_parameters = | 143 const bool allow_duplicate_parameters = |
| 144 is_sloppy(function_scope->language_mode()) && formals.is_simple && | 144 is_sloppy(function_scope->language_mode()) && formals.is_simple && |
| 145 !IsConciseMethod(kind); | 145 !IsConciseMethod(kind); |
| 146 ValidateFormalParameters(function_scope->language_mode(), | 146 ValidateFormalParameters(function_scope->language_mode(), |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| 293 #undef CHECK_OK | 293 #undef CHECK_OK |
| 294 #undef CHECK_OK_CUSTOM | 294 #undef CHECK_OK_CUSTOM |
| 295 | 295 |
| 296 | 296 |
| 297 } // namespace internal | 297 } // namespace internal |
| 298 } // namespace v8 | 298 } // namespace v8 |
| OLD | NEW |