JSCallbackData::invokeCallback() should return the Exception to the caller
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Aug 2015 02:31:23 +0000 (02:31 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Aug 2015 02:31:23 +0000 (02:31 +0000)
commitc0f06b8a359fbb8d98df4d084d912613c90c9b31
treed93e09175f2bbd6dbda31cf5ae007b02c4c105d6
parent4e3d80d31ea49fecef81b99af944721b8b5c5845
JSCallbackData::invokeCallback() should return the Exception to the caller
https://bugs.webkit.org/show_bug.cgi?id=148591

Reviewed by Mark Lam.

JSCallbackData::invokeCallback() calls a callback function. If this
function throws an exception, it will report it and clear it on the VM.
However, in the case of NodeFilter, the DOM specification clearly states
that we are supposed to rethrow the exception [1].

Once way to support this is to have JSCallbackData::invokeCallback()
return the Exception to the caller and let the caller decide what to do
with it (i.e. report it or rethrow it).

There is no actual behavior change in this patch. This slight
refactoring is in preparation for Bug 148415.

[1] https://dom.spec.whatwg.org/#traversal

Some more context at:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17713#c16

* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCallbackData.h:
* bindings/js/JSCustomSQLStatementErrorCallback.cpp:
(WebCore::JSSQLStatementErrorCallback::handleEvent):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackImplementation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSCallbackData.cpp
Source/WebCore/bindings/js/JSCallbackData.h
Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm