Fix details in message formatting. (issue 11360220)

2 views
Skip to first unread message

yan...@chromium.org

unread,
Nov 13, 2012, 3:53:16 AM11/13/12
to sven...@chromium.org, v8-...@googlegroups.com
Reviewers: Sven Panne,

Message:
PTAL.

Description:
Fix details in message formatting.


BUG=


Please review this at http://codereview.chromium.org/11360220/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
M src/isolate.cc
M src/messages.js


Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index
eec5a54d737e902caddfcfe5679dcb33656c8dd1..98b3c3acbd662deecea62779f7ad3e4a131d616d
100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1231,7 +1231,7 @@ void Isolate::DoThrow(Object* exception,
MessageLocation* location) {
// 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);
+ exception_handle = Execution::ToDetailString(exception_handle,
&failed);
if (failed) {
exception_handle = factory()->LookupAsciiSymbol("exception");
}
Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index
30f6682adab6c5c2cd91a96cbed1a07f9aca8604..3d6c8ce2d88ba983e42d37c15c9e0ffcfa125e73
100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -190,6 +190,7 @@ function NoSideEffectToString(obj) {
if (IS_BOOLEAN(obj)) return x ? 'true' : 'false';
if (IS_UNDEFINED(obj)) return 'undefined';
if (IS_NULL(obj)) return 'null';
+ if (IS_FUNCTION(obj)) return %_CallFunction(obj, FunctionToString);
if (IS_OBJECT(obj) && %GetDataProperty(obj, "toString") ===
ObjectToString) {
var constructor = obj.constructor;
if (typeof constructor == "function") {


sven...@chromium.org

unread,
Nov 13, 2012, 3:56:42 AM11/13/12
to yan...@chromium.org, v8-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages