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

Unified Diff: src/parsing/preparser.h

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 side-by-side diff with in-line comments
Download patch
Index: src/parsing/preparser.h
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h
index e45e2f070c7023237cb1772531486774df3e6b34..90fdf57164b4106648b95d6dcd7a2ab979914e29 100644
--- a/src/parsing/preparser.h
+++ b/src/parsing/preparser.h
@@ -839,11 +839,13 @@ class PreParser : public ParserBase<PreParser> {
};
PreParser(Zone* zone, Scanner* scanner, AstValueFactory* ast_value_factory,
+ PendingCompilationErrorHandler* pending_error_handler,
uintptr_t stack_limit)
: ParserBase<PreParser>(zone, scanner, stack_limit, nullptr,
ast_value_factory),
use_counts_(nullptr),
- track_unresolved_variables_(false) {}
+ track_unresolved_variables_(false),
+ pending_error_handler_(pending_error_handler) {}
PreParserLogger* logger() { return &log_; }
@@ -1274,8 +1276,9 @@ class PreParser : public ParserBase<PreParser> {
MessageTemplate::Template message,
const char* arg = NULL,
ParseErrorType error_type = kSyntaxError) {
- log_.LogMessage(source_location.beg_pos, source_location.end_pos, message,
- arg, error_type);
+ pending_error_handler_->ReportMessageAt(source_location.beg_pos,
+ source_location.end_pos, message,
+ arg, error_type);
}
V8_INLINE void ReportMessageAt(Scanner::Location source_location,
@@ -1509,6 +1512,7 @@ class PreParser : public ParserBase<PreParser> {
int* use_counts_;
bool track_unresolved_variables_;
PreParserLogger log_;
+ PendingCompilationErrorHandler* pending_error_handler_;
};
PreParserExpression PreParser::SpreadCall(PreParserExpression function,

Powered by Google App Engine
This is Rietveld 408576698