Title: [200553] trunk/Source/WebCore
Revision
200553
Author
[email protected]
Date
2016-05-08 00:11:12 -0700 (Sun, 08 May 2016)

Log Message

Try to fix build without rolling out that last change.

* bindings/js/JSDOMConvert.h:
(WebCore::convert<Vector<String>>): Make this an inline. Just call toNativeArray.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (200552 => 200553)


--- trunk/Source/WebCore/ChangeLog	2016-05-08 06:39:23 UTC (rev 200552)
+++ trunk/Source/WebCore/ChangeLog	2016-05-08 07:11:12 UTC (rev 200553)
@@ -1,3 +1,10 @@
+2016-05-08  Darin Adler  <[email protected]>
+
+        Try to fix build without rolling out that last change.
+
+        * bindings/js/JSDOMConvert.h:
+        (WebCore::convert<Vector<String>>): Make this an inline. Just call toNativeArray.
+
 2016-05-07  Darin Adler  <[email protected]>
 
         Change MutationObserver::observe to take an IDL dictionary, rather than WebCore::Dictionary

Modified: trunk/Source/WebCore/bindings/js/JSDOMConvert.h (200552 => 200553)


--- trunk/Source/WebCore/bindings/js/JSDOMConvert.h	2016-05-08 06:39:23 UTC (rev 200552)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvert.h	2016-05-08 07:11:12 UTC (rev 200553)
@@ -67,25 +67,10 @@
     return static_cast<T>(number);
 }
 
-template<> Vector<String> convert<Vector<String>>(JSC::ExecState& state, JSC::JSValue value)
+template<> inline Vector<String> convert<Vector<String>>(JSC::ExecState& state, JSC::JSValue value)
 {
-    // FIXME: This code has a lot in common with toNativeArray.
-    // Should find a way to share code.
-    unsigned length;
-    auto* object = toJSSequence(&state, value, length);
-    if (state.hadException())
-        return { };
-    Vector<String> vector;
-    vector.reserveInitialCapacity(length);
-    for (unsigned i = 0 ; i < length; ++i) {
-        auto itemValue = object->get(&state, i);
-        if (state.hadException())
-            return { };
-        vector.uncheckedAppend(convert<String>(state, itemValue));
-        if (state.hadException())
-            return { };
-    }
-    return vector;
+    // FIXME: The toNativeArray function doesn't throw a type error if the value is not an object. Is that really OK?
+    return toNativeArray<String>(&state, value);
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to