Title: [205953] trunk
Revision
205953
Author
commit-qu...@webkit.org
Date
2016-09-15 00:21:18 -0700 (Thu, 15 Sep 2016)

Log Message

callPromiseFunction should be made usable for custom binding code
https://bugs.webkit.org/show_bug.cgi?id=161961

Patch by Youenn Fablet <you...@apple.com> on 2016-09-15
Reviewed by Darin Adler.

Source/WebCore:

Covered by updated test.

* bindings/js/JSDOMBinding.h:
(WebCore::castThisValue): Utility function to cast this value to a specific type.
* bindings/js/JSDOMPromise.h:
(WebCore::callPromiseFunction): Updated to take real promise function as a template parameter
for improved efficiency. Added workerMode template parameter.
(WebCore::bindingPromiseFunctionAdapter): Function signature adaptor.
* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::JSMediaDevicesGetUserMediaPromiseFunction):
(WebCore::JSMediaDevices::getUserMedia): Making use of callPromiseFunction to properly handle exceptions.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Updated to use template parameter.
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::jsTestNodePrototypeFunctionTestWorkerPromise):
(WebCore::jsTestNodePrototypeFunctionTestWorkerPromisePromise):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException):
* bindings/scripts/test/TestNode.idl: Adding Worker promise binding test.

LayoutTests:

* fast/mediastream/MediaDevices-getUserMedia-expected.txt:
* fast/mediastream/MediaDevices-getUserMedia.html: Updated to expect a rejected promise in lieu of an exception.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (205952 => 205953)


--- trunk/LayoutTests/ChangeLog	2016-09-15 06:57:12 UTC (rev 205952)
+++ trunk/LayoutTests/ChangeLog	2016-09-15 07:21:18 UTC (rev 205953)
@@ -1,3 +1,13 @@
+2016-09-15  Youenn Fablet  <you...@apple.com>
+
+        callPromiseFunction should be made usable for custom binding code
+        https://bugs.webkit.org/show_bug.cgi?id=161961
+
+        Reviewed by Darin Adler.
+
+        * fast/mediastream/MediaDevices-getUserMedia-expected.txt:
+        * fast/mediastream/MediaDevices-getUserMedia.html: Updated to expect a rejected promise in lieu of an exception.
+
 2016-09-14  Jiewen Tan  <jiewen_...@apple.com>
 
         Unreviewed, update ios-simulator-wk1 test expectations after migrating to iOS 10

Modified: trunk/LayoutTests/fast/mediastream/MediaDevices-getUserMedia-expected.txt (205952 => 205953)


--- trunk/LayoutTests/fast/mediastream/MediaDevices-getUserMedia-expected.txt	2016-09-15 06:57:12 UTC (rev 205952)
+++ trunk/LayoutTests/fast/mediastream/MediaDevices-getUserMedia-expected.txt	2016-09-15 07:21:18 UTC (rev 205953)
@@ -3,10 +3,10 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS navigator.mediaDevices.getUserMedia().then(invalidGotStream); threw exception TypeError: Not enough arguments.
 PASS typeof navigator.mediaDevices.webkitGetUserMedia is 'undefined'
 PASS navigator.mediaDevices.getUserMedia({audio:true}).then(gotStream1); did not throw exception.
-PASS  navigator.mediaDevices.getUserMedia({}) rejected with error: TypeError: Type error
+PASS navigator.mediaDevices.getUserMedia() rejected with error: TypeError: Not enough arguments
+PASS navigator.mediaDevices.getUserMedia({}) rejected with error: TypeError: Type error
 PASS Stream generated.
 PASS stream.getAudioTracks().length is 1
 PASS stream.getVideoTracks().length is 0

Modified: trunk/LayoutTests/fast/mediastream/MediaDevices-getUserMedia.html (205952 => 205953)


--- trunk/LayoutTests/fast/mediastream/MediaDevices-getUserMedia.html	2016-09-15 06:57:12 UTC (rev 205952)
+++ trunk/LayoutTests/fast/mediastream/MediaDevices-getUserMedia.html	2016-09-15 07:21:18 UTC (rev 205953)
@@ -136,9 +136,11 @@
                 shouldNotThrow("navigator.mediaDevices.getUserMedia({video:true}).then(gotStream2);")
             }
 
-            shouldThrow("navigator.mediaDevices.getUserMedia().then(invalidGotStream);");
+            navigator.mediaDevices.getUserMedia().then(invalidGotStream, function(error) {
+                testPassed("navigator.mediaDevices.getUserMedia() rejected with error: " + error);
+            });
             navigator.mediaDevices.getUserMedia({}).then(invalidGotStream, function(error) {
-                testPassed(" navigator.mediaDevices.getUserMedia({}) rejected with error: " + error);
+                testPassed("navigator.mediaDevices.getUserMedia({}) rejected with error: " + error);
             });
             shouldBe("typeof navigator.mediaDevices.webkitGetUserMedia", "'undefined'");
             setUserMediaPermission(true);

Modified: trunk/Source/WebCore/ChangeLog (205952 => 205953)


--- trunk/Source/WebCore/ChangeLog	2016-09-15 06:57:12 UTC (rev 205952)
+++ trunk/Source/WebCore/ChangeLog	2016-09-15 07:21:18 UTC (rev 205953)
@@ -1,3 +1,37 @@
+2016-09-15  Youenn Fablet  <you...@apple.com>
+
+        callPromiseFunction should be made usable for custom binding code
+        https://bugs.webkit.org/show_bug.cgi?id=161961
+
+        Reviewed by Darin Adler.
+
+        Covered by updated test.
+
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::castThisValue): Utility function to cast this value to a specific type.
+        * bindings/js/JSDOMPromise.h:
+        (WebCore::callPromiseFunction): Updated to take real promise function as a template parameter
+        for improved efficiency. Added workerMode template parameter.
+        (WebCore::bindingPromiseFunctionAdapter): Function signature adaptor.
+        * bindings/js/JSMediaDevicesCustom.cpp:
+        (WebCore::JSMediaDevicesGetUserMediaPromiseFunction):
+        (WebCore::JSMediaDevices::getUserMedia): Making use of callPromiseFunction to properly handle exceptions.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation): Updated to use template parameter.
+        * bindings/scripts/test/JS/JSTestNode.cpp:
+        (WebCore::jsTestNodePrototypeFunctionTestWorkerPromise):
+        (WebCore::jsTestNodePrototypeFunctionTestWorkerPromisePromise):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2):
+        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction):
+        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException):
+        * bindings/scripts/test/TestNode.idl: Adding Worker promise binding test.
+
 2016-09-14  Jiewen Tan  <jiewen_...@apple.com>
 
         WebCrypto algorithms should be exposed via KeyAlgorithm dictionary

Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (205952 => 205953)


--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h	2016-09-15 06:57:12 UTC (rev 205952)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h	2016-09-15 07:21:18 UTC (rev 205953)
@@ -173,6 +173,8 @@
 
 template<typename DOMClass> JSC::JSValue wrap(JSC::ExecState*, JSDOMGlobalObject*, DOMClass&);
 
+template<typename JSClass> JSClass& castThisValue(JSC::ExecState&);
+
 void addImpureProperty(const AtomicString&);
 
 const JSC::HashTable& getHashTableForGlobalData(JSC::VM&, const JSC::HashTable& staticTable);
@@ -529,6 +531,14 @@
     return toJSNewlyCreated(state, globalObject, Ref<DOMClass>(domObject));
 }
 
+template<typename JSClass> inline JSClass& castThisValue(JSC::ExecState& state)
+{
+    auto thisValue = state.thisValue();
+    auto castedThis = JSC::jsDynamicCast<JSClass*>(thisValue);
+    ASSERT(castedThis);
+    return *castedThis;
+}
+
 inline int32_t finiteInt32Value(JSC::JSValue value, JSC::ExecState* exec, bool& okay)
 {
     double number = value.toNumber(exec);

Modified: trunk/Source/WebCore/bindings/js/JSDOMPromise.h (205952 => 205953)


--- trunk/Source/WebCore/bindings/js/JSDOMPromise.h	2016-09-15 06:57:12 UTC (rev 205952)
+++ trunk/Source/WebCore/bindings/js/JSDOMPromise.h	2016-09-15 07:21:18 UTC (rev 205953)
@@ -157,7 +157,12 @@
 void fulfillPromiseWithArrayBuffer(Ref<DeferredWrapper>&&, const void*, size_t);
 void rejectPromiseWithExceptionIfAny(JSC::ExecState&, JSDOMGlobalObject&, JSC::JSPromiseDeferred&);
 
-inline JSC::JSValue callPromiseFunction(JSC::ExecState& state, JSC::EncodedJSValue promiseFunction(JSC::ExecState*, Ref<DeferredWrapper>&&))
+using PromiseFunction = void(JSC::ExecState&, Ref<DeferredWrapper>&&);
+
+enum class PromiseExecutionScope { WindowOnly, WindowOrWorker };
+
+template<PromiseFunction promiseFunction, PromiseExecutionScope executionScope>
+inline JSC::JSValue callPromiseFunction(JSC::ExecState& state)
 {
     JSC::VM& vm = state.vm();
     auto scope = DECLARE_CATCH_SCOPE(vm);
@@ -166,10 +171,10 @@
     JSC::JSPromiseDeferred* promiseDeferred = JSC::JSPromiseDeferred::create(&state, &globalObject);
 
     // promiseDeferred can be null when terminating a Worker abruptly.
-    if (!promiseDeferred)
+    if (executionScope == PromiseExecutionScope::WindowOrWorker && !promiseDeferred)
         return JSC::jsUndefined();
 
-    promiseFunction(&state, DeferredWrapper::create(&state, &globalObject, promiseDeferred));
+    promiseFunction(state, DeferredWrapper::create(&state, &globalObject, promiseDeferred));
 
     rejectPromiseWithExceptionIfAny(state, globalObject, *promiseDeferred);
     ASSERT_UNUSED(scope, !scope.exception());
@@ -176,6 +181,19 @@
     return promiseDeferred->promise();
 }
 
+using BindingPromiseFunction = JSC::EncodedJSValue(JSC::ExecState*, Ref<DeferredWrapper>&&);
+template<BindingPromiseFunction bindingFunction>
+inline void bindingPromiseFunctionAdapter(JSC::ExecState& state, Ref<DeferredWrapper>&& promise)
+{
+    bindingFunction(&state, WTFMove(promise));
+}
+
+template<BindingPromiseFunction bindingPromiseFunction, PromiseExecutionScope executionScope>
+inline JSC::JSValue callPromiseFunction(JSC::ExecState& state)
+{
+    return callPromiseFunction<bindingPromiseFunctionAdapter<bindingPromiseFunction>, executionScope>(state);
+}
+
 // At the moment, Value cannot be a Ref<T> or RefPtr<T>, it should be a DOM class.
 template <typename Value>
 class DOMPromise {

Modified: trunk/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp (205952 => 205953)


--- trunk/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp	2016-09-15 06:57:12 UTC (rev 205952)
+++ trunk/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp	2016-09-15 07:21:18 UTC (rev 205953)
@@ -340,13 +340,16 @@
     }
 }
 
-JSValue JSMediaDevices::getUserMedia(ExecState& state)
+static void JSMediaDevicesGetUserMediaPromiseFunction(ExecState& state, Ref<DeferredWrapper>&& promise)
 {
     VM& vm = state.vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
 
-    if (UNLIKELY(state.argumentCount() < 1))
-        return JSValue::decode(throwVMError(&state, scope, createNotEnoughArgumentsError(&state)));
+    if (UNLIKELY(state.argumentCount() < 1)) {
+        throwVMError(&state, scope, createNotEnoughArgumentsError(&state));
+        return;
+    }
+
     ExceptionCode ec = 0;
     auto constraintsDictionary = Dictionary(&state, state.uncheckedArgument(0));
 
@@ -374,12 +377,15 @@
 
     auto audioConstraints = MediaConstraintsImpl::create(WTFMove(mandatoryAudioConstraints), WTFMove(advancedAudioConstraints), areAudioConstraintsValid);
     auto videoConstraints = MediaConstraintsImpl::create(WTFMove(mandatoryVideoConstraints), WTFMove(advancedVideoConstraints), areVideoConstraintsValid);
-    JSC::JSPromiseDeferred* promiseDeferred = JSC::JSPromiseDeferred::create(&state, globalObject());
-    wrapped().getUserMedia(WTFMove(audioConstraints), WTFMove(videoConstraints), DeferredWrapper::create(&state, globalObject(), promiseDeferred), ec);
+    castThisValue<JSMediaDevices>(state).wrapped().getUserMedia(WTFMove(audioConstraints), WTFMove(videoConstraints), WTFMove(promise), ec);
     setDOMException(&state, ec);
-    return promiseDeferred->promise();
 }
 
+JSValue JSMediaDevices::getUserMedia(ExecState& state)
+{
+    return callPromiseFunction<JSMediaDevicesGetUserMediaPromiseFunction, PromiseExecutionScope::WindowOnly>(state);
 }
 
+}
+
 #endif

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (205952 => 205953)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-09-15 06:57:12 UTC (rev 205952)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-09-15 07:21:18 UTC (rev 205953)
@@ -3421,14 +3421,17 @@
             if (IsReturningPromise($function) && !$isCustom) {
                 AddToImplIncludes("JSDOMPromise.h");
 
+                my $scope = $interface->extendedAttributes->{"Exposed"} ? "WindowOrWorker" : "WindowOnly";
                 push(@implContent, <<END);
 static EncodedJSValue ${functionName}Promise(ExecState*, Ref<DeferredWrapper>&&);
+
 ${functionReturn} ${functionName}(ExecState* state)
 {
-    return JSValue::encode(callPromiseFunction(*state, ${functionName}Promise));
+    ASSERT(state);
+    return JSValue::encode(callPromiseFunction<${functionName}Promise, PromiseExecutionScope::${scope}>(*state));
 }
 
-static inline EncodedJSValue ${functionName}Promise(ExecState* state, Ref<DeferredWrapper>&&  deferredWrapper)
+static inline EncodedJSValue ${functionName}Promise(ExecState* state, Ref<DeferredWrapper>&& deferredWrapper)
 END
             }
             else {

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp (205952 => 205953)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp	2016-09-15 06:57:12 UTC (rev 205952)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp	2016-09-15 07:21:18 UTC (rev 205953)
@@ -25,6 +25,7 @@
 #include "JSDOMBinding.h"
 #include "JSDOMConstructor.h"
 #include "JSDOMIterator.h"
+#include "JSDOMPromise.h"
 #include "RuntimeEnabledFeatures.h"
 #include "URL.h"
 #include <runtime/Error.h>
@@ -37,6 +38,7 @@
 
 // Functions
 
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionTestWorkerPromise(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionSymbolIterator(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionEntries(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionKeys(JSC::ExecState*);
@@ -108,6 +110,7 @@
 {
     { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNodeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNodeConstructor) } },
     { "name", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNodeName), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNodeName) } },
+    { "testWorkerPromise", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNodePrototypeFunctionTestWorkerPromise), (intptr_t) (0) } },
     { "entries", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNodePrototypeFunctionEntries), (intptr_t) (0) } },
     { "keys", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNodePrototypeFunctionKeys), (intptr_t) (0) } },
     { "values", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNodePrototypeFunctionValues), (intptr_t) (0) } },
@@ -228,6 +231,28 @@
     return getDOMConstructor<JSTestNodeConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
 }
 
+static EncodedJSValue jsTestNodePrototypeFunctionTestWorkerPromisePromise(ExecState*, Ref<DeferredWrapper>&&);
+EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionTestWorkerPromise(ExecState* state)
+{
+    ASSERT(state);
+    return JSValue::encode(callPromiseFunction<jsTestNodePrototypeFunctionTestWorkerPromisePromise, true>(*state));
+}
+
+static inline EncodedJSValue jsTestNodePrototypeFunctionTestWorkerPromisePromise(ExecState* state, Ref<DeferredWrapper>&&  deferredWrapper)
+{
+    VM& vm = state->vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    UNUSED_PARAM(throwScope);
+    JSValue thisValue = state->thisValue();
+    auto castedThis = jsDynamicCast<JSTestNode*>(thisValue);
+    if (UNLIKELY(!castedThis))
+        return throwThisTypeError(*state, throwScope, "TestNode", "testWorkerPromise");
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestNode::info());
+    auto& impl = castedThis->wrapped();
+    impl.testWorkerPromise(WTFMove(deferredWrapper));
+    return JSValue::encode(jsUndefined());
+}
+
 using TestNodeIterator = JSDOMIterator<JSTestNode>;
 using TestNodeIteratorPrototype = JSDOMIteratorPrototype<JSTestNode>;
 

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (205952 => 205953)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-09-15 06:57:12 UTC (rev 205952)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-09-15 07:21:18 UTC (rev 205953)
@@ -7160,7 +7160,8 @@
 static EncodedJSValue jsTestObjPrototypeFunctionTestPromiseFunctionPromise(ExecState*, Ref<DeferredWrapper>&&);
 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseFunction(ExecState* state)
 {
-    return JSValue::encode(callPromiseFunction(*state, jsTestObjPrototypeFunctionTestPromiseFunctionPromise));
+    ASSERT(state);
+    return JSValue::encode(callPromiseFunction<jsTestObjPrototypeFunctionTestPromiseFunctionPromise, false>(*state));
 }
 
 static inline EncodedJSValue jsTestObjPrototypeFunctionTestPromiseFunctionPromise(ExecState* state, Ref<DeferredWrapper>&&  deferredWrapper)
@@ -7181,7 +7182,8 @@
 static EncodedJSValue jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise(ExecState*, Ref<DeferredWrapper>&&);
 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument(ExecState* state)
 {
-    return JSValue::encode(callPromiseFunction(*state, jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise));
+    ASSERT(state);
+    return JSValue::encode(callPromiseFunction<jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise, false>(*state));
 }
 
 static inline EncodedJSValue jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise(ExecState* state, Ref<DeferredWrapper>&&  deferredWrapper)
@@ -7207,7 +7209,8 @@
 static EncodedJSValue jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise(ExecState*, Ref<DeferredWrapper>&&);
 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseFunctionWithException(ExecState* state)
 {
-    return JSValue::encode(callPromiseFunction(*state, jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise));
+    ASSERT(state);
+    return JSValue::encode(callPromiseFunction<jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise, false>(*state));
 }
 
 static inline EncodedJSValue jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise(ExecState* state, Ref<DeferredWrapper>&&  deferredWrapper)
@@ -7230,7 +7233,8 @@
 static EncodedJSValue jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise(ExecState*, Ref<DeferredWrapper>&&);
 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument(ExecState* state)
 {
-    return JSValue::encode(callPromiseFunction(*state, jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise));
+    ASSERT(state);
+    return JSValue::encode(callPromiseFunction<jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise, false>(*state));
 }
 
 static inline EncodedJSValue jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise(ExecState* state, Ref<DeferredWrapper>&&  deferredWrapper)
@@ -7254,7 +7258,8 @@
 static EncodedJSValue jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise(ExecState*, Ref<DeferredWrapper>&&);
 static inline EncodedJSValue jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1(ExecState* state)
 {
-    return JSValue::encode(callPromiseFunction(*state, jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise));
+    ASSERT(state);
+    return JSValue::encode(callPromiseFunction<jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise, false>(*state));
 }
 
 static inline EncodedJSValue jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise(ExecState* state, Ref<DeferredWrapper>&&  deferredWrapper)
@@ -7280,7 +7285,8 @@
 static EncodedJSValue jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise(ExecState*, Ref<DeferredWrapper>&&);
 static inline EncodedJSValue jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2(ExecState* state)
 {
-    return JSValue::encode(callPromiseFunction(*state, jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise));
+    ASSERT(state);
+    return JSValue::encode(callPromiseFunction<jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise, false>(*state));
 }
 
 static inline EncodedJSValue jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise(ExecState* state, Ref<DeferredWrapper>&&  deferredWrapper)
@@ -7323,7 +7329,8 @@
 static EncodedJSValue jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise(ExecState*, Ref<DeferredWrapper>&&);
 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionTestStaticPromiseFunction(ExecState* state)
 {
-    return JSValue::encode(callPromiseFunction(*state, jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise));
+    ASSERT(state);
+    return JSValue::encode(callPromiseFunction<jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise, false>(*state));
 }
 
 static inline EncodedJSValue jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise(ExecState* state, Ref<DeferredWrapper>&&  deferredWrapper)
@@ -7338,7 +7345,8 @@
 static EncodedJSValue jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise(ExecState*, Ref<DeferredWrapper>&&);
 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException(ExecState* state)
 {
-    return JSValue::encode(callPromiseFunction(*state, jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise));
+    ASSERT(state);
+    return JSValue::encode(callPromiseFunction<jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise, false>(*state));
 }
 
 static inline EncodedJSValue jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise(ExecState* state, Ref<DeferredWrapper>&&  deferredWrapper)

Modified: trunk/Source/WebCore/bindings/scripts/test/TestNode.idl (205952 => 205953)


--- trunk/Source/WebCore/bindings/scripts/test/TestNode.idl	2016-09-15 06:57:12 UTC (rev 205952)
+++ trunk/Source/WebCore/bindings/scripts/test/TestNode.idl	2016-09-15 07:21:18 UTC (rev 205953)
@@ -21,9 +21,10 @@
 [
     Constructor,
     ExportMacro=WEBCORE_TESTSUPPORT_EXPORT,
+    Exposed=(Window,Worker)
 ] interface TestNode : Node {
     attribute DOMString name;
 
     [EnabledAtRuntime=DOMIterator] iterable<TestNode>;
+    Promise testWorkerPromise();
 };
-
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to