Update bindings test results after
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Aug 2015 05:45:41 +0000 (05:45 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Aug 2015 05:45:41 +0000 (05:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148591

JSCallbackData::invokeCallback() should return the Exception to the caller

* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallback::callbackWithNoParam):
(WebCore::JSTestCallback::callbackWithArrayParam):
(WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
(WebCore::JSTestCallback::callbackWithStringList):
(WebCore::JSTestCallback::callbackWithBoolean):
(WebCore::JSTestCallback::callbackRequiresThisToPass):
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
(WebCore::JSTestCallbackFunction::callbackWithNoParam):
(WebCore::JSTestCallbackFunction::callbackWithArrayParam):
(WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
(WebCore::JSTestCallbackFunction::callbackWithStringList):
(WebCore::JSTestCallbackFunction::callbackWithBoolean):
(WebCore::JSTestCallbackFunction::callbackRequiresThisToPass):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189143 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp

index 51fcf6b..eedec16 100644 (file)
@@ -1,3 +1,25 @@
+2015-08-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Update bindings test results after
+        https://bugs.webkit.org/show_bug.cgi?id=148591
+
+        JSCallbackData::invokeCallback() should return the Exception to the caller
+
+        * bindings/scripts/test/JS/JSTestCallback.cpp:
+        (WebCore::JSTestCallback::callbackWithNoParam):
+        (WebCore::JSTestCallback::callbackWithArrayParam):
+        (WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
+        (WebCore::JSTestCallback::callbackWithStringList):
+        (WebCore::JSTestCallback::callbackWithBoolean):
+        (WebCore::JSTestCallback::callbackRequiresThisToPass):
+        * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
+        (WebCore::JSTestCallbackFunction::callbackWithNoParam):
+        (WebCore::JSTestCallbackFunction::callbackWithArrayParam):
+        (WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
+        (WebCore::JSTestCallbackFunction::callbackWithStringList):
+        (WebCore::JSTestCallbackFunction::callbackWithBoolean):
+        (WebCore::JSTestCallbackFunction::callbackRequiresThisToPass):
+
 2015-08-28  Chris Dumez  <cdumez@apple.com>
 
         JSCallbackData::invokeCallback() should return the Exception to the caller
index 23b1233..4bd597d 100644 (file)
@@ -129,9 +129,11 @@ bool JSTestCallback::callbackWithNoParam()
     ExecState* exec = m_data->globalObject()->globalExec();
     MarkedArgumentBuffer args;
 
-    bool raisedException = false;
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackWithNoParam"), &raisedException);
-    return !raisedException;
+    NakedPtr<Exception> returnedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackWithNoParam"), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 bool JSTestCallback::callbackWithArrayParam(RefPtr<Float32Array> arrayParam)
@@ -147,9 +149,11 @@ bool JSTestCallback::callbackWithArrayParam(RefPtr<Float32Array> arrayParam)
     MarkedArgumentBuffer args;
     args.append(toJS(exec, m_data->globalObject(), WTF::getPtr(arrayParam)));
 
-    bool raisedException = false;
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackWithArrayParam"), &raisedException);
-    return !raisedException;
+    NakedPtr<Exception> returnedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackWithArrayParam"), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 bool JSTestCallback::callbackWithSerializedScriptValueParam(PassRefPtr<SerializedScriptValue> srzParam, const String& strArg)
@@ -166,9 +170,11 @@ bool JSTestCallback::callbackWithSerializedScriptValueParam(PassRefPtr<Serialize
     args.append(srzParam ? srzParam->deserialize(exec, castedThis->globalObject(), 0) : jsNull());
     args.append(jsStringWithCache(exec, strArg));
 
-    bool raisedException = false;
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackWithSerializedScriptValueParam"), &raisedException);
-    return !raisedException;
+    NakedPtr<Exception> returnedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackWithSerializedScriptValueParam"), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 bool JSTestCallback::callbackWithStringList(PassRefPtr<DOMStringList> listParam)
@@ -184,9 +190,11 @@ bool JSTestCallback::callbackWithStringList(PassRefPtr<DOMStringList> listParam)
     MarkedArgumentBuffer args;
     args.append(toJS(exec, m_data->globalObject(), WTF::getPtr(listParam)));
 
-    bool raisedException = false;
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackWithStringList"), &raisedException);
-    return !raisedException;
+    NakedPtr<Exception> returnedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackWithStringList"), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 bool JSTestCallback::callbackWithBoolean(bool boolParam)
@@ -202,9 +210,11 @@ bool JSTestCallback::callbackWithBoolean(bool boolParam)
     MarkedArgumentBuffer args;
     args.append(jsBoolean(boolParam));
 
-    bool raisedException = false;
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackWithBoolean"), &raisedException);
-    return !raisedException;
+    NakedPtr<Exception> returnedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackWithBoolean"), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 bool JSTestCallback::callbackRequiresThisToPass(int longParam, TestNode* testNodeParam)
@@ -221,9 +231,11 @@ bool JSTestCallback::callbackRequiresThisToPass(int longParam, TestNode* testNod
     args.append(jsNumber(longParam));
     args.append(toJS(exec, m_data->globalObject(), WTF::getPtr(testNodeParam)));
 
-    bool raisedException = false;
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackRequiresThisToPass"), &raisedException);
-    return !raisedException;
+    NakedPtr<Exception> returnedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(exec, "callbackRequiresThisToPass"), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 }
index 3e6e27e..0c45c3f 100644 (file)
@@ -74,10 +74,12 @@ bool JSTestCallbackFunction::callbackWithNoParam()
     ExecState* exec = m_data->globalObject()->globalExec();
     MarkedArgumentBuffer args;
 
-    bool raisedException = false;
+    NakedPtr<Exception> returnedException;
     UNUSED_PARAM(exec);
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), &raisedException);
-    return !raisedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 bool JSTestCallbackFunction::callbackWithArrayParam(RefPtr<Float32Array> arrayParam)
@@ -93,10 +95,12 @@ bool JSTestCallbackFunction::callbackWithArrayParam(RefPtr<Float32Array> arrayPa
     MarkedArgumentBuffer args;
     args.append(toJS(exec, m_data->globalObject(), WTF::getPtr(arrayParam)));
 
-    bool raisedException = false;
+    NakedPtr<Exception> returnedException;
     UNUSED_PARAM(exec);
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), &raisedException);
-    return !raisedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 bool JSTestCallbackFunction::callbackWithSerializedScriptValueParam(PassRefPtr<SerializedScriptValue> srzParam, const String& strArg)
@@ -113,10 +117,12 @@ bool JSTestCallbackFunction::callbackWithSerializedScriptValueParam(PassRefPtr<S
     args.append(srzParam ? srzParam->deserialize(exec, castedThis->globalObject(), 0) : jsNull());
     args.append(jsStringWithCache(exec, strArg));
 
-    bool raisedException = false;
+    NakedPtr<Exception> returnedException;
     UNUSED_PARAM(exec);
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), &raisedException);
-    return !raisedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 bool JSTestCallbackFunction::callbackWithStringList(PassRefPtr<DOMStringList> listParam)
@@ -132,10 +138,12 @@ bool JSTestCallbackFunction::callbackWithStringList(PassRefPtr<DOMStringList> li
     MarkedArgumentBuffer args;
     args.append(toJS(exec, m_data->globalObject(), WTF::getPtr(listParam)));
 
-    bool raisedException = false;
+    NakedPtr<Exception> returnedException;
     UNUSED_PARAM(exec);
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), &raisedException);
-    return !raisedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 bool JSTestCallbackFunction::callbackWithBoolean(bool boolParam)
@@ -151,10 +159,12 @@ bool JSTestCallbackFunction::callbackWithBoolean(bool boolParam)
     MarkedArgumentBuffer args;
     args.append(jsBoolean(boolParam));
 
-    bool raisedException = false;
+    NakedPtr<Exception> returnedException;
     UNUSED_PARAM(exec);
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), &raisedException);
-    return !raisedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 bool JSTestCallbackFunction::callbackRequiresThisToPass(int longParam, TestNode* testNodeParam)
@@ -171,10 +181,12 @@ bool JSTestCallbackFunction::callbackRequiresThisToPass(int longParam, TestNode*
     args.append(jsNumber(longParam));
     args.append(toJS(exec, m_data->globalObject(), WTF::getPtr(testNodeParam)));
 
-    bool raisedException = false;
+    NakedPtr<Exception> returnedException;
     UNUSED_PARAM(exec);
-    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), &raisedException);
-    return !raisedException;
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+    if (returnedException)
+        reportException(exec, returnedException);
+    return !returnedException;
 }
 
 }