Index: Source/bindings/v8/V8ErrorHandler.cpp |
diff --git a/Source/bindings/v8/V8ErrorHandler.cpp b/Source/bindings/v8/V8ErrorHandler.cpp |
index 035e9ceddae569a376193001fb2820a739531e29..715033b9b876c02fd5979697be6b0b9d5d08bfc1 100644 |
--- a/Source/bindings/v8/V8ErrorHandler.cpp |
+++ b/Source/bindings/v8/V8ErrorHandler.cpp |
@@ -31,8 +31,10 @@ |
#include "config.h" |
#include "bindings/v8/V8ErrorHandler.h" |
+#include "bindings/v8/DOMWrapperWorld.h" |
#include "bindings/v8/ScriptController.h" |
#include "bindings/v8/V8Binding.h" |
+#include "bindings/v8/V8HiddenPropertyName.h" |
#include "bindings/v8/V8ScriptRunner.h" |
#include "core/dom/ErrorEvent.h" |
#include "core/dom/EventNames.h" |
@@ -56,7 +58,11 @@ v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(ScriptExecutionContext |
if (!listener.IsEmpty() && listener->IsFunction()) { |
v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener); |
v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global(); |
- v8::Handle<v8::Value> parameters[4] = { v8String(errorEvent->message(), isolate), v8String(errorEvent->filename(), isolate), v8::Integer::New(errorEvent->lineno(), isolate), v8::Integer::New(errorEvent->column(), isolate) }; |
+ |
+ v8::Handle<v8::Value> error = DOMWrapperWorld::current()->worldId() == errorEvent->error().v8Value()->ToObject()->GetHiddenValue(V8HiddenPropertyName::worldId())->IntegerValue() ? |
+ errorEvent->error().v8Value() : v8::Local<v8::Value>(v8::Undefined(isolate)); |
+ |
+ v8::Handle<v8::Value> parameters[5] = { v8String(errorEvent->message(), isolate), v8String(errorEvent->filename(), isolate), v8::Integer::New(errorEvent->lineno(), isolate), v8::Integer::New(errorEvent->column(), isolate), error }; |
v8::TryCatch tryCatch; |
tryCatch.SetVerbose(true); |
if (worldType(isolate) == WorkerWorld) |