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

Unified Diff: src/isolate.cc

Issue 11359130: Make formatting error message side-effect-free. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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
« no previous file with comments | « no previous file | src/messages.js » ('j') | src/runtime.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 75e15a454196573fce28a438032a7fe68e966ddb..b077a70f6b90aa1ae679c9802f8ed8faeb343622 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1138,6 +1138,14 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) {
stack_trace_for_uncaught_exceptions_options_);
}
}
+ // Stringify custom error objects for the message object.
+ if (exception_handle->IsJSObject() && !IsErrorObject(exception_handle)) {
+ bool failed = false;
+ exception_handle = Execution::ToString(exception_handle, &failed);
+ if (failed) {
+ exception_handle = factory()->LookupAsciiSymbol("exception");
+ }
+ }
Handle<Object> message_obj = MessageHandler::MakeMessageObject(
"uncaught_exception",
location,
« no previous file with comments | « no previous file | src/messages.js » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698