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

Unified Diff: src/messages.cc

Issue 8050: Changed the message reporting for try { ... } finally { ... } statements to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 2 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 | src/top.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.cc
===================================================================
--- src/messages.cc (revision 557)
+++ src/messages.cc (working copy)
@@ -96,15 +96,26 @@
script.location(),
stack_trace_val.location() };
+ // Setup a catch handler to catch exceptions in creating the message. This
+ // handler is non-verbose to avoid calling MakeMessage recursively in case of
+ // an exception.
+ v8::TryCatch catcher;
+ catcher.SetVerbose(false);
+ catcher.SetCaptureMessage(false);
+
+ // Format the message.
bool caught_exception = false;
Handle<Object> message =
- Execution::TryCall(fun, Factory::undefined_value(), argc, argv,
- &caught_exception);
- // If creating the message (in JS code) resulted in an exception, we
- // skip doing the callback. This usually only happens in case of
- // stack overflow exceptions being thrown by the parser when the
- // stack is almost full.
- if (caught_exception) return Handle<Object>();
+ Execution::Call(fun, Factory::undefined_value(), argc, argv,
+ &caught_exception);
+ if (caught_exception) {
+ // If creating the message (in JS code) resulted in an exception, we
+ // skip doing the callback. This usually only happens in case of
+ // stack overflow exceptions being thrown by the parser when the
+ // stack is almost full.
+ if (caught_exception) return Handle<Object>();
+ }
+
return message.EscapeFrom(&scope);
}
« no previous file with comments | « no previous file | src/top.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698