Title: [203065] trunk/Source/WebCore
Revision
203065
Author
[email protected]
Date
2016-07-11 09:26:00 -0700 (Mon, 11 Jul 2016)

Log Message

toNative functions in JSDOMBinding.h should take an ExecState reference instead of pointer
https://bugs.webkit.org/show_bug.cgi?id=159298

Reviewed by Youenn Fablet.

Pass ExecState by reference instead of pointer.

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyPathFromValue):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSDOMBinding.h: Pass ExecState by reference instead of pointer.
(WebCore::toJSSequence):
(WebCore::NativeValueTraits<String>::nativeValue):
(WebCore::NativeValueTraits<unsigned>::nativeValue):
(WebCore::NativeValueTraits<float>::nativeValue):
(WebCore::NativeValueTraits<double>::nativeValue):
(WebCore::toNativeArray):
(WebCore::toNativeArguments):
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<Vector<T>>::convert):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::fillMessagePortArray):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
(JSValueToNative):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArray):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArrayIsEmpty):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
(WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
(WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
(WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
(WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence2):
(WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
(WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
(WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors5):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionFunc):
(WebCore::jsTestTypedefsPrototypeFunctionNullableArrayArg):
(WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction):
(WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction2):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (203064 => 203065)


--- trunk/Source/WebCore/ChangeLog	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/ChangeLog	2016-07-11 16:26:00 UTC (rev 203065)
@@ -1,3 +1,58 @@
+2016-07-11  Nael Ouedraogo  <[email protected]>
+
+        toNative functions in JSDOMBinding.h should take an ExecState reference instead of pointer
+        https://bugs.webkit.org/show_bug.cgi?id=159298
+
+        Reviewed by Youenn Fablet.
+
+        Pass ExecState by reference instead of pointer.
+
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::idbKeyPathFromValue):
+        * bindings/js/JSBlobCustom.cpp:
+        (WebCore::constructJSBlob):
+        * bindings/js/JSDOMBinding.h: Pass ExecState by reference instead of pointer.
+        (WebCore::toJSSequence):
+        (WebCore::NativeValueTraits<String>::nativeValue):
+        (WebCore::NativeValueTraits<unsigned>::nativeValue):
+        (WebCore::NativeValueTraits<float>::nativeValue):
+        (WebCore::NativeValueTraits<double>::nativeValue):
+        (WebCore::toNativeArray):
+        (WebCore::toNativeArguments):
+        * bindings/js/JSDOMConvert.h:
+        (WebCore::Converter<Vector<T>>::convert):
+        * bindings/js/JSDictionary.cpp:
+        (WebCore::JSDictionary::convertValue):
+        * bindings/js/JSFileCustom.cpp:
+        (WebCore::constructJSFile):
+        * bindings/js/JSMessagePortCustom.cpp:
+        (WebCore::fillMessagePortArray):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateParametersCheck):
+        (JSValueToNative):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArray):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArrayIsEmpty):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
+        (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence2):
+        (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
+        (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
+        (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
+        (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+        (WebCore::constructJSTestOverloadedConstructors5):
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        (WebCore::jsTestTypedefsPrototypeFunctionFunc):
+        (WebCore::jsTestTypedefsPrototypeFunctionNullableArrayArg):
+        (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction):
+        (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction2):
+
 2016-07-08  Alex Christensen  <[email protected]>
 
         Use refs for ResourceLoaders

Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (203064 => 203065)


--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2016-07-11 16:26:00 UTC (rev 203065)
@@ -176,7 +176,7 @@
 {
     IDBKeyPath keyPath;
     if (isJSArray(keyPathValue))
-        keyPath = IDBKeyPath(toNativeArray<String>(&exec, keyPathValue));
+        keyPath = IDBKeyPath(toNativeArray<String>(exec, keyPathValue));
     else
         keyPath = IDBKeyPath(keyPathValue.toWTFString(&exec));
     return keyPath;

Modified: trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp (203064 => 203065)


--- trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp	2016-07-11 16:26:00 UTC (rev 203065)
@@ -72,7 +72,7 @@
     }
 
     unsigned blobPartsLength = 0;
-    JSObject* blobParts = toJSSequence(&exec, exec.uncheckedArgument(0), blobPartsLength);
+    JSObject* blobParts = toJSSequence(exec, exec.uncheckedArgument(0), blobPartsLength);
     if (exec.hadException())
         return JSValue::encode(jsUndefined());
     ASSERT(blobParts);

Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (203064 => 203065)


--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h	2016-07-11 16:26:00 UTC (rev 203065)
@@ -247,7 +247,7 @@
 double valueToDate(JSC::ExecState*, JSC::JSValue);
 
 // Validates that the passed object is a sequence type per section 4.1.13 of the WebIDL spec.
-JSC::JSObject* toJSSequence(JSC::ExecState*, JSC::JSValue, unsigned& length);
+JSC::JSObject* toJSSequence(JSC::ExecState&, JSC::JSValue, unsigned& length);
 
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, JSC::ArrayBuffer*);
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, JSC::ArrayBufferView*);
@@ -282,8 +282,8 @@
 RefPtr<JSC::Float64Array> toFloat64Array(JSC::JSValue);
 
 template<typename T, typename JSType> Vector<RefPtr<T>> toRefPtrNativeArray(JSC::ExecState*, JSC::JSValue, T* (*)(JSC::JSValue));
-template<typename T> Vector<T> toNativeArray(JSC::ExecState*, JSC::JSValue);
-template<typename T> Vector<T> toNativeArguments(JSC::ExecState*, size_t startIndex = 0);
+template<typename T> Vector<T> toNativeArray(JSC::ExecState&, JSC::JSValue);
+template<typename T> Vector<T> toNativeArguments(JSC::ExecState&, size_t startIndex = 0);
 
 bool shouldAllowAccessToNode(JSC::ExecState*, Node*);
 bool shouldAllowAccessToFrame(JSC::ExecState*, Frame*);
@@ -477,25 +477,25 @@
 }
 
 // Validates that the passed object is a sequence type per section 4.1.13 of the WebIDL spec.
-inline JSC::JSObject* toJSSequence(JSC::ExecState* exec, JSC::JSValue value, unsigned& length)
+inline JSC::JSObject* toJSSequence(JSC::ExecState& exec, JSC::JSValue value, unsigned& length)
 {
     JSC::JSObject* object = value.getObject();
     if (!object) {
-        throwSequenceTypeError(*exec);
+        throwSequenceTypeError(exec);
         return nullptr;
     }
 
-    JSC::JSValue lengthValue = object->get(exec, exec->propertyNames().length);
-    if (exec->hadException())
+    JSC::JSValue lengthValue = object->get(&exec, exec.propertyNames().length);
+    if (exec.hadException())
         return nullptr;
 
     if (lengthValue.isUndefinedOrNull()) {
-        throwSequenceTypeError(*exec);
+        throwSequenceTypeError(exec);
         return nullptr;
     }
 
-    length = lengthValue.toUInt32(exec);
-    if (exec->hadException())
+    length = lengthValue.toUInt32(&exec);
+    if (exec.hadException())
         return nullptr;
 
     return object;
@@ -660,21 +660,21 @@
 template<typename T> struct NativeValueTraits;
 
 template<> struct NativeValueTraits<String> {
-    static inline bool nativeValue(JSC::ExecState* exec, JSC::JSValue jsValue, String& indexedValue)
+    static inline bool nativeValue(JSC::ExecState& exec, JSC::JSValue jsValue, String& indexedValue)
     {
-        indexedValue = jsValue.toWTFString(exec);
+        indexedValue = jsValue.toWTFString(&exec);
         return true;
     }
 };
 
 template<> struct NativeValueTraits<unsigned> {
-    static inline bool nativeValue(JSC::ExecState* exec, JSC::JSValue jsValue, unsigned& indexedValue)
+    static inline bool nativeValue(JSC::ExecState& exec, JSC::JSValue jsValue, unsigned& indexedValue)
     {
         if (!jsValue.isNumber())
             return false;
 
-        indexedValue = jsValue.toUInt32(exec);
-        if (exec->hadException())
+        indexedValue = jsValue.toUInt32(&exec);
+        if (exec.hadException())
             return false;
 
         return true;
@@ -682,18 +682,18 @@
 };
 
 template<> struct NativeValueTraits<float> {
-    static inline bool nativeValue(JSC::ExecState* exec, JSC::JSValue jsValue, float& indexedValue)
+    static inline bool nativeValue(JSC::ExecState& exec, JSC::JSValue jsValue, float& indexedValue)
     {
-        indexedValue = jsValue.toFloat(exec);
-        return !exec->hadException();
+        indexedValue = jsValue.toFloat(&exec);
+        return !exec.hadException();
     }
 };
 
 template<> struct NativeValueTraits<double> {
-    static inline bool nativeValue(JSC::ExecState* exec, JSC::JSValue jsValue, double& indexedValue)
+    static inline bool nativeValue(JSC::ExecState& exec, JSC::JSValue jsValue, double& indexedValue)
     {
-        indexedValue = jsValue.toNumber(exec);
-        return !exec->hadException();
+        indexedValue = jsValue.toNumber(&exec);
+        return !exec.hadException();
     }
 };
 
@@ -718,7 +718,7 @@
     return result;
 }
 
-template<typename T> Vector<T> toNativeArray(JSC::ExecState* exec, JSC::JSValue value)
+template<typename T> Vector<T> toNativeArray(JSC::ExecState& exec, JSC::JSValue value)
 {
     JSC::JSObject* object = value.getObject();
     if (!object)
@@ -737,7 +737,7 @@
 
     for (unsigned i = 0; i < length; ++i) {
         T indexValue;
-        if (!TraitsType::nativeValue(exec, object->get(exec, i), indexValue))
+        if (!TraitsType::nativeValue(exec, object->get(&exec, i), indexValue))
             return Vector<T>();
         result.uncheckedAppend(indexValue);
     }
@@ -744,9 +744,9 @@
     return result;
 }
 
-template<typename T> Vector<T> toNativeArguments(JSC::ExecState* exec, size_t startIndex)
+template<typename T> Vector<T> toNativeArguments(JSC::ExecState& exec, size_t startIndex)
 {
-    size_t length = exec->argumentCount();
+    size_t length = exec.argumentCount();
     ASSERT(startIndex <= length);
 
     Vector<T> result;
@@ -755,7 +755,7 @@
 
     for (size_t i = startIndex; i < length; ++i) {
         T indexValue;
-        if (!TraitsType::nativeValue(exec, exec->argument(i), indexValue))
+        if (!TraitsType::nativeValue(exec, exec.uncheckedArgument(i), indexValue))
             return Vector<T>();
         result.uncheckedAppend(indexValue);
     }

Modified: trunk/Source/WebCore/bindings/js/JSDOMConvert.h (203064 => 203065)


--- trunk/Source/WebCore/bindings/js/JSDOMConvert.h	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvert.h	2016-07-11 16:26:00 UTC (rev 203065)
@@ -122,7 +122,7 @@
     static Vector<T> convert(JSC::ExecState& state, JSC::JSValue value)
     {
         // FIXME: The toNativeArray function doesn't throw a type error if the value is not an object. Is that OK?
-        return toNativeArray<T>(&state, value);
+        return toNativeArray<T>(state, value);
     }
 };
 

Modified: trunk/Source/WebCore/bindings/js/JSDictionary.cpp (203064 => 203065)


--- trunk/Source/WebCore/bindings/js/JSDictionary.cpp	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.cpp	2016-07-11 16:26:00 UTC (rev 203065)
@@ -149,11 +149,12 @@
 
 void JSDictionary::convertValue(ExecState* exec, JSValue value, Vector<String>& result)
 {
+    ASSERT(exec);
     if (value.isUndefinedOrNull())
         return;
 
     unsigned length = 0;
-    JSObject* object = toJSSequence(exec, value, length);
+    JSObject* object = toJSSequence(*exec, value, length);
     if (exec->hadException())
         return;
 
@@ -210,6 +211,7 @@
 
 void JSDictionary::convertValue(ExecState* exec, JSValue value, HashSet<AtomicString>& result)
 {
+    ASSERT(exec);
     result.clear();
 
     if (value.isUndefinedOrNull())
@@ -216,7 +218,7 @@
         return;
 
     unsigned length = 0;
-    JSObject* object = toJSSequence(exec, value, length);
+    JSObject* object = toJSSequence(*exec, value, length);
     if (exec->hadException())
         return;
 
@@ -280,11 +282,12 @@
 
 void JSDictionary::convertValue(ExecState* exec, JSValue value, Vector<RefPtr<MediaStream>>& result)
 {
+    ASSERT(exec);
     if (value.isUndefinedOrNull())
         return;
 
     unsigned length = 0;
-    JSObject* object = toJSSequence(exec, value, length);
+    JSObject* object = toJSSequence(*exec, value, length);
     if (exec->hadException())
         return;
 

Modified: trunk/Source/WebCore/bindings/js/JSFileCustom.cpp (203064 => 203065)


--- trunk/Source/WebCore/bindings/js/JSFileCustom.cpp	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/bindings/js/JSFileCustom.cpp	2016-07-11 16:26:00 UTC (rev 203065)
@@ -52,7 +52,7 @@
         return throwVMTypeError(&exec, ASCIILiteral("First argument to File constructor must be a valid sequence, was undefined or null"));
 
     unsigned blobPartsLength = 0;
-    JSObject* blobParts = toJSSequence(&exec, arg, blobPartsLength);
+    JSObject* blobParts = toJSSequence(exec, arg, blobPartsLength);
     if (exec.hadException())
         return JSValue::encode(jsUndefined());
     ASSERT(blobParts);

Modified: trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp (203064 => 203065)


--- trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp	2016-07-11 16:26:00 UTC (rev 203065)
@@ -69,7 +69,7 @@
 
     // Validation of sequence types, per WebIDL spec 4.1.13.
     unsigned length = 0;
-    JSObject* object = toJSSequence(&state, value, length);
+    JSObject* object = toJSSequence(state, value, length);
     if (state.hadException())
         return;
 

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (203064 => 203065)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-07-11 16:26:00 UTC (rev 203065)
@@ -3717,7 +3717,7 @@
                 push(@$outputArray, "        $name.uncheckedAppend(item);\n");
                 push(@$outputArray, "    }\n")
             } else {
-                push(@$outputArray, "    Vector<$nativeElementType> $name = toNativeArguments<$nativeElementType>(state, $argumentIndex);\n");
+                push(@$outputArray, "    Vector<$nativeElementType> $name = toNativeArguments<$nativeElementType>(*state, $argumentIndex);\n");
                 push(@$outputArray, "    if (UNLIKELY(state->hadException()))\n");
                 push(@$outputArray, "        return JSValue::encode(jsUndefined());\n");
             }
@@ -4454,7 +4454,7 @@
             AddToImplIncludes("JS${arrayOrSequenceType}.h");
             return ("(toRefPtrNativeArray<${arrayOrSequenceType}, JS${arrayOrSequenceType}>(state, $value, &JS${arrayOrSequenceType}::toWrapped))", 1);
         }
-        return ("toNativeArray<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">(state, $value)", 1);
+        return ("toNativeArray<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">(*state, $value)", 1);
     }
 
     return ($value, 0) if $type eq "any";

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


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-07-11 16:26:00 UTC (rev 203065)
@@ -4904,7 +4904,7 @@
         return throwThisTypeError(*state, "TestObj", "methodWithOptionalSequence");
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     auto& impl = castedThis->wrapped();
-    auto sequence = toNativeArray<String>(state, state->argument(0));
+    auto sequence = toNativeArray<String>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithOptionalSequence(WTFMove(sequence));
@@ -4979,7 +4979,7 @@
         return throwThisTypeError(*state, "TestObj", "methodWithOptionalArray");
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     auto& impl = castedThis->wrapped();
-    auto array = state->argument(0).isUndefined() ? Optional<Vector<String>>() : toNativeArray<String>(state, state->uncheckedArgument(0));
+    auto array = state->argument(0).isUndefined() ? Optional<Vector<String>>() : toNativeArray<String>(*state, state->uncheckedArgument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithOptionalArray(WTFMove(array));
@@ -4994,7 +4994,7 @@
         return throwThisTypeError(*state, "TestObj", "methodWithOptionalArrayIsEmpty");
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     auto& impl = castedThis->wrapped();
-    auto array = toNativeArray<String>(state, state->argument(0));
+    auto array = toNativeArray<String>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithOptionalArrayIsEmpty(WTFMove(array));
@@ -5377,7 +5377,7 @@
     auto& impl = castedThis->wrapped();
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, createNotEnoughArgumentsError(state));
-    auto arrayArg = toNativeArray<String>(state, state->argument(0));
+    auto arrayArg = toNativeArray<String>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(WTFMove(arrayArg));
@@ -5411,7 +5411,7 @@
     auto& impl = castedThis->wrapped();
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, createNotEnoughArgumentsError(state));
-    auto arrayArg = toNativeArray<String>(state, state->argument(0));
+    auto arrayArg = toNativeArray<String>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(WTFMove(arrayArg));
@@ -5428,7 +5428,7 @@
     auto& impl = castedThis->wrapped();
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, createNotEnoughArgumentsError(state));
-    auto arrayArg = toNativeArray<uint32_t>(state, state->argument(0));
+    auto arrayArg = toNativeArray<uint32_t>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(WTFMove(arrayArg));
@@ -5674,7 +5674,7 @@
     auto& impl = castedThis->wrapped();
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, createNotEnoughArgumentsError(state));
-    auto unsignedLongSequence = toNativeArray<uint32_t>(state, state->argument(0));
+    auto unsignedLongSequence = toNativeArray<uint32_t>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithUnsignedLongSequence(WTFMove(unsignedLongSequence));
@@ -5692,7 +5692,7 @@
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, createNotEnoughArgumentsError(state));
     ExceptionCode ec = 0;
-    auto values = toNativeArray<String>(state, state->argument(0));
+    auto values = toNativeArray<String>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsArray(state, castedThis->globalObject(), impl.stringArrayFunction(WTFMove(values), ec));
@@ -5733,10 +5733,10 @@
     auto& impl = castedThis->wrapped();
     if (UNLIKELY(state->argumentCount() < 2))
         return throwVMError(state, createNotEnoughArgumentsError(state));
-    auto arrayArg = toNativeArray<uint32_t>(state, state->argument(0));
+    auto arrayArg = toNativeArray<uint32_t>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
-    auto nullableArrayArg = toNativeArray<uint32_t>(state, state->argument(1));
+    auto nullableArrayArg = toNativeArray<uint32_t>(*state, state->argument(1));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithAndWithoutNullableSequence(WTFMove(arrayArg), WTFMove(nullableArrayArg));
@@ -5753,10 +5753,10 @@
     auto& impl = castedThis->wrapped();
     if (UNLIKELY(state->argumentCount() < 2))
         return throwVMError(state, createNotEnoughArgumentsError(state));
-    auto arrayArg = toNativeArray<uint32_t>(state, state->argument(0));
+    auto arrayArg = toNativeArray<uint32_t>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
-    auto nullableArrayArg = toNativeArray<uint32_t>(state, state->argument(1));
+    auto nullableArrayArg = toNativeArray<uint32_t>(*state, state->argument(1));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithAndWithoutNullableSequence2(WTFMove(arrayArg), WTFMove(nullableArrayArg));
@@ -5942,7 +5942,7 @@
         if (UNLIKELY(!objArg))
             return throwArgumentTypeError(*state, 0, "objArg", "TestObj", "strictFunctionWithSequence", "TestObj");
     }
-    auto a = toNativeArray<uint32_t>(state, state->argument(1));
+    auto a = toNativeArray<uint32_t>(*state, state->argument(1));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsBoolean(impl.strictFunctionWithSequence(objArg, WTFMove(a), ec));
@@ -5965,7 +5965,7 @@
     auto objArg = JSTestObj::toWrapped(state->argument(0));
     if (UNLIKELY(!objArg))
         return throwArgumentTypeError(*state, 0, "objArg", "TestObj", "strictFunctionWithArray", "TestObj");
-    auto array = toNativeArray<int32_t>(state, state->argument(1));
+    auto array = toNativeArray<int32_t>(*state, state->argument(1));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsBoolean(impl.strictFunctionWithArray(*objArg, WTFMove(array), ec));
@@ -5987,7 +5987,7 @@
     auto head = state->argument(0).toWTFString(state);
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
-    Vector<String> tail = toNativeArguments<String>(state, 1);
+    Vector<String> tail = toNativeArguments<String>(*state, 1);
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.variadicStringMethod(WTFMove(head), WTFMove(tail));
@@ -6007,7 +6007,7 @@
     auto head = convert<double>(*state, state->argument(0), ShouldAllowNonFinite::Yes);
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
-    Vector<double> tail = toNativeArguments<double>(state, 1);
+    Vector<double> tail = toNativeArguments<double>(*state, 1);
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.variadicDoubleMethod(WTFMove(head), WTFMove(tail));

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (203064 => 203065)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp	2016-07-11 16:26:00 UTC (rev 203065)
@@ -120,7 +120,7 @@
 static inline EncodedJSValue constructJSTestOverloadedConstructors5(ExecState* state)
 {
     auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(state->callee());
-    Vector<int32_t> longArgs = toNativeArguments<int32_t>(state, 0);
+    Vector<int32_t> longArgs = toNativeArguments<int32_t>(*state, 0);
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     auto object = TestOverloadedConstructors::create(longArgs);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (203064 => 203065)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp	2016-07-11 16:01:04 UTC (rev 203064)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp	2016-07-11 16:26:00 UTC (rev 203065)
@@ -455,7 +455,7 @@
         return throwThisTypeError(*state, "TestTypedefs", "func");
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestTypedefs::info());
     auto& impl = castedThis->wrapped();
-    auto x = toNativeArray<int32_t>(state, state->argument(0));
+    auto x = toNativeArray<int32_t>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.func(WTFMove(x));
@@ -518,7 +518,7 @@
     auto& impl = castedThis->wrapped();
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, createNotEnoughArgumentsError(state));
-    auto arrayArg = toNativeArray<String>(state, state->argument(0));
+    auto arrayArg = toNativeArray<String>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     impl.nullableArrayArg(WTFMove(arrayArg));
@@ -568,7 +568,7 @@
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, createNotEnoughArgumentsError(state));
     ExceptionCode ec = 0;
-    auto values = toNativeArray<String>(state, state->argument(0));
+    auto values = toNativeArray<String>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsArray(state, castedThis->globalObject(), impl.stringArrayFunction(WTFMove(values), ec));
@@ -588,7 +588,7 @@
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, createNotEnoughArgumentsError(state));
     ExceptionCode ec = 0;
-    auto values = toNativeArray<String>(state, state->argument(0));
+    auto values = toNativeArray<String>(*state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsArray(state, castedThis->globalObject(), impl.stringArrayFunction2(WTFMove(values), ec));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to