Index: Source/bindings/v8/V8ErrorHandler.cpp |
diff --git a/Source/bindings/v8/V8WindowErrorHandler.cpp b/Source/bindings/v8/V8ErrorHandler.cpp |
similarity index 79% |
rename from Source/bindings/v8/V8WindowErrorHandler.cpp |
rename to Source/bindings/v8/V8ErrorHandler.cpp |
index 46c6469960b8898b4e1e3a02cf1dd6362e7ffc66..ac8414db063110cfd0a18732ba3fe7778e379a5b 100644 |
--- a/Source/bindings/v8/V8WindowErrorHandler.cpp |
+++ b/Source/bindings/v8/V8ErrorHandler.cpp |
@@ -29,22 +29,23 @@ |
*/ |
#include "config.h" |
- |
-#include "bindings/v8/V8WindowErrorHandler.h" |
+#include "bindings/v8/V8ErrorHandler.h" |
#include "bindings/v8/ScriptController.h" |
#include "bindings/v8/V8Binding.h" |
+#include "bindings/v8/V8RecursionScope.h" |
+#include "bindings/v8/V8ScriptRunner.h" |
#include "core/dom/ErrorEvent.h" |
#include "core/dom/EventNames.h" |
namespace WebCore { |
-V8WindowErrorHandler::V8WindowErrorHandler(v8::Local<v8::Object> listener, bool isInline) |
+V8ErrorHandler::V8ErrorHandler(v8::Local<v8::Object> listener, bool isInline) |
: V8EventListener(listener, isInline) |
{ |
} |
-v8::Local<v8::Value> V8WindowErrorHandler::callListenerFunction(ScriptExecutionContext* context, v8::Handle<v8::Value> jsEvent, Event* event) |
+v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(ScriptExecutionContext* context, v8::Handle<v8::Value> jsEvent, Event* event) |
{ |
if (!event->hasInterface(eventNames().interfaceForErrorEvent)) |
return V8EventListener::callListenerFunction(context, jsEvent, event); |
@@ -59,12 +60,15 @@ v8::Local<v8::Value> V8WindowErrorHandler::callListenerFunction(ScriptExecutionC |
v8::Handle<v8::Value> parameters[3] = { v8String(errorEvent->message(), isolate), v8String(errorEvent->filename(), isolate), v8Integer(errorEvent->lineno(), isolate) }; |
v8::TryCatch tryCatch; |
tryCatch.SetVerbose(true); |
- returnValue = ScriptController::callFunctionWithInstrumentation(0, callFunction, thisValue, 3, parameters); |
+ if (worldType(isolate) == WorkerWorld) |
+ returnValue = V8ScriptRunner::callFunction(callFunction, context, thisValue, WTF_ARRAY_LENGTH(parameters), parameters); |
+ else |
+ returnValue = ScriptController::callFunctionWithInstrumentation(0, callFunction, thisValue, 3, parameters); |
} |
return returnValue; |
} |
-bool V8WindowErrorHandler::shouldPreventDefault(v8::Local<v8::Value> returnValue) |
+bool V8ErrorHandler::shouldPreventDefault(v8::Local<v8::Value> returnValue) |
{ |
return returnValue->IsBoolean() && returnValue->BooleanValue(); |
} |