Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=22310
Worker exceptions should be printed to console
* dom/Document.cpp: (WebCore::Document::reportException):
* dom/Document.h:
* dom/ScriptExecutionContext.h:
* dom/WorkerContext.cpp: (WebCore::WorkerContext::reportException):
* dom/WorkerContext.h:
Added a reportException() method on ScriptExecutionContext. It forwards the exception info
up until it finds a Document context, and then it prints it to console.
* bindings/js/JSEventListener.cpp:
(WebCore::JSAbstractEventListener::handleEvent): Don't talk to Console directly, use
ScriptExecutionContext::reportException. Also, fixed a bug where Document::updateDocumentsRendering()
could be called from workers.
(WebCore::JSLazyEventListener::parseCode): Moved variable declaration inside if block for clarity.
* bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::evaluate):
Report exceptions to ScriptExecutionContext.
* dom/WorkerMessagingProxy.cpp:
(WebCore::MessageWorkerTask::performTask):
(WebCore::WorkerExceptionTask::create):
(WebCore::WorkerExceptionTask::WorkerExceptionTask):
(WebCore::WorkerExceptionTask::performTask):
(WebCore::WorkerMessagingProxy::postWorkerException):
* dom/WorkerMessagingProxy.h:
Added a task for posting exception information.
* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
(WebCore::reportCurrentException):
* bindings/js/JSDOMBinding.h:
Added helper methods for reporting exceptions via ScriptExecutionContext.
* page/Console.cpp:
* page/Console.h:
Removed methods for directly reporting exceptions to console.
* bindings/js/JSCustomPositionCallback.cpp:
(WebCore::JSCustomPositionCallback::handleEvent):
* bindings/js/JSCustomPositionErrorCallback.cpp:
(WebCore::JSCustomPositionErrorCallback::handleEvent):
* bindings/js/JSCustomSQLStatementCallback.cpp:
(WebCore::JSCustomSQLStatementCallback::handleEvent):
* bindings/js/JSCustomSQLStatementErrorCallback.cpp:
(WebCore::JSCustomSQLStatementErrorCallback::handleEvent):
* bindings/js/JSCustomSQLTransactionCallback.cpp:
(WebCore::JSCustomSQLTransactionCallback::handleEvent):
* bindings/js/JSCustomSQLTransactionErrorCallback.cpp:
(WebCore::JSCustomSQLTransactionErrorCallback::handleEvent):
* bindings/js/JSCustomVoidCallback.cpp:
(WebCore::JSCustomVoidCallback::handleEvent):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::execute):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluate):
* bindings/objc/WebScriptObject.mm:
(WebCore::addExceptionToConsole):
Switch to JSDOMBinding methods for reporting exceptions.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38595 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/bindings/js/ScheduledAction.cpp b/WebCore/bindings/js/ScheduledAction.cpp
index 8d13cd2..5aaf23a 100644
--- a/WebCore/bindings/js/ScheduledAction.cpp
+++ b/WebCore/bindings/js/ScheduledAction.cpp
@@ -24,11 +24,11 @@
#include "ScheduledAction.h"
#include "CString.h"
-#include "Console.h"
#include "DOMWindow.h"
#include "Document.h"
#include "Frame.h"
#include "FrameLoader.h"
+#include "JSDOMBinding.h"
#include "JSDOMWindow.h"
#include "ScriptController.h"
#include <runtime/JSLock.h>
@@ -74,7 +74,7 @@
call(exec, m_function, callType, callData, windowShell, args);
window->stopTimeoutCheck();
if (exec->hadException())
- frame->domWindow()->console()->reportCurrentException(exec);
+ reportCurrentException(exec);
}
} else
frame->loader()->executeScript(m_code);