Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: src/parsing/preparser.cc

Issue 2502633002: [parser] Only log messages using the pending error handling (Closed)
Patch Set: Delete more unused code Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698