| Index: Source/bindings/v8/V8Initializer.cpp | 
| diff --git a/Source/bindings/v8/V8Initializer.cpp b/Source/bindings/v8/V8Initializer.cpp | 
| index d521b34126f8e733ce1ee598f5ea7df1b29e7677..8d5ee8b9b594c93a1a53b3916b407ac4c425c548 100644 | 
| --- a/Source/bindings/v8/V8Initializer.cpp | 
| +++ b/Source/bindings/v8/V8Initializer.cpp | 
| @@ -26,13 +26,16 @@ | 
| #include "config.h" | 
| #include "bindings/v8/V8Initializer.h" | 
|  | 
| +#include "V8ErrorEvent.h" | 
| #include "V8History.h" | 
| #include "V8Location.h" | 
| #include "V8Window.h" | 
| +#include "bindings/v8/DOMWrapperWorld.h" | 
| #include "bindings/v8/ScriptCallStackFactory.h" | 
| #include "bindings/v8/ScriptProfiler.h" | 
| #include "bindings/v8/V8Binding.h" | 
| #include "bindings/v8/V8GCController.h" | 
| +#include "bindings/v8/V8HiddenPropertyName.h" | 
| #include "bindings/v8/V8PerContextData.h" | 
| #include "core/dom/Document.h" | 
| #include "core/dom/ExceptionCode.h" | 
| @@ -94,7 +97,13 @@ 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); | 
| -    firstWindow->document()->reportException(errorMessage, message->GetLineNumber(), message->GetStartColumn(), resource, callStack); | 
| +    RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, resource, message->GetLineNumber(), message->GetStartColumn()); | 
| +    v8::Local<v8::Value> wrappedEvent = toV8(event.get(), v8::Handle<v8::Object>(), v8::Isolate::GetCurrent()); | 
| +    if (!wrappedEvent.IsEmpty()) { | 
| +        ASSERT(wrappedEvent->IsObject()); | 
| +        v8::Local<v8::Object>::Cast(wrappedEvent)->SetHiddenValue(V8HiddenPropertyName::error(), data); | 
| +    } | 
| +    firstWindow->document()->reportException(event.release(), callStack); | 
| } | 
|  | 
| static void failedAccessCheckCallbackInMainThread(v8::Local<v8::Object> host, v8::AccessType type, v8::Local<v8::Value> data) | 
| @@ -162,10 +171,14 @@ static void messageHandlerInWorker(v8::Handle<v8::Message> message, v8::Handle<v | 
| // During the frame teardown, there may not be a valid context. | 
| if (ScriptExecutionContext* context = getScriptExecutionContext()) { | 
| String errorMessage = toWebCoreString(message->Get()); | 
| -        int lineNumber = message->GetLineNumber(); | 
| -        int columnNumber = message->GetStartColumn(); | 
| String sourceURL = toWebCoreString(message->GetScriptResourceName()); | 
| -        context->reportException(errorMessage, lineNumber, columnNumber, sourceURL, 0); | 
| +        RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, message->GetLineNumber(), message->GetStartColumn()); | 
| +        v8::Local<v8::Value> wrappedEvent = toV8(event.get(), v8::Handle<v8::Object>(), v8::Isolate::GetCurrent()); | 
| +        if (!wrappedEvent.IsEmpty()) { | 
| +            ASSERT(wrappedEvent->IsObject()); | 
| +            v8::Local<v8::Object>::Cast(wrappedEvent)->SetHiddenValue(V8HiddenPropertyName::error(), data); | 
| +        } | 
| +        context->reportException(event.release(), 0); | 
| } | 
|  | 
| isReportingException = false; | 
|  |