| Index: Source/bindings/v8/V8Initializer.cpp
|
| diff --git a/Source/bindings/v8/V8Initializer.cpp b/Source/bindings/v8/V8Initializer.cpp
|
| index d2e2d9c26a1e2b149bc5fc1e486d06d518e791fe..7df8a88c23ac7f48ee524962fb1b5046169187c9 100644
|
| --- a/Source/bindings/v8/V8Initializer.cpp
|
| +++ b/Source/bindings/v8/V8Initializer.cpp
|
| @@ -26,6 +26,7 @@
|
| #include "config.h"
|
| #include "bindings/v8/V8Initializer.h"
|
|
|
| +#include "V8DOMException.h"
|
| #include "V8ErrorEvent.h"
|
| #include "V8History.h"
|
| #include "V8Location.h"
|
| @@ -99,9 +100,19 @@ static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Hand
|
| v8::Handle<v8::Value> resourceName = message->GetScriptResourceName();
|
| bool shouldUseDocumentURL = resourceName.IsEmpty() || !resourceName->IsString();
|
| String resource = shouldUseDocumentURL ? firstWindow->document()->url() : toWebCoreString(resourceName);
|
| - RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, resource, message->GetLineNumber(), message->GetStartColumn());
|
| AccessControlStatus corsStatus = message->IsSharedCrossOrigin() ? SharableCrossOrigin : NotSharableCrossOrigin;
|
|
|
| + RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, resource, message->GetLineNumber(), message->GetStartColumn());
|
| + if (data->IsObject()) {
|
| + v8::Handle<v8::Object> obj = v8::Handle<v8::Object>::Cast(data);
|
| + WrapperTypeInfo* type = toWrapperTypeInfo(obj);
|
| + if (V8DOMException::info.isSubclass(type)) {
|
| + DOMException* exception = V8DOMException::toNative(obj);
|
| + if (exception && !exception->messageForConsole().isEmpty())
|
| + event->setUnsanitizedMessage("Uncaught " + exception->toStringForConsole());
|
| + }
|
| + }
|
| +
|
| // This method might be called while we're creating a new context. In this case, we
|
| // avoid storing the exception object, as we can't create a wrapper during context creation.
|
| DOMWrapperWorld* world = DOMWrapperWorld::current();
|
|
|