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

Unified Diff: src/parser.cc

Issue 194713013: Parser: fix confusion when there are multiple errors to report. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index c6c72fefbba7cdbd9614e467d2942f2ba61dc9e4..de46bb8d1db7c36d12a9e71c26f07b061642ced6 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -452,6 +452,12 @@ bool ParserTraits::IsEvalOrArguments(Handle<String> identifier) const {
void ParserTraits::ReportMessageAt(Scanner::Location source_location,
const char* message,
Vector<const char*> args) {
+ if (parser_->stack_overflow()) {
+ // Suppress the error message (syntax error or such) in the presence of a
+ // stack overflow. The isolate allows only one pending exception at at time
+ // and we want to report the stack overflow later.
+ return;
+ }
MessageLocation location(parser_->script_,
source_location.beg_pos,
source_location.end_pos);
@@ -477,6 +483,12 @@ void ParserTraits::ReportMessage(const char* message,
void ParserTraits::ReportMessageAt(Scanner::Location source_location,
const char* message,
Vector<Handle<String> > args) {
+ if (parser_->stack_overflow()) {
+ // Suppress the error message (syntax error or such) in the presence of a
+ // stack overflow. The isolate allows only one pending exception at at time
+ // and we want to report the stack overflow later.
+ return;
+ }
MessageLocation location(parser_->script_,
source_location.beg_pos,
source_location.end_pos);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698