Title: [120719] trunk/Source/WebCore
Revision
120719
Author
[email protected]
Date
2012-06-19 08:47:29 -0700 (Tue, 19 Jun 2012)

Log Message

[JSC] Implement support for JSDictionary::convertValue(Vector<String>& result)
https://bugs.webkit.org/show_bug.cgi?id=89447

Patch by Christophe Dumez <[email protected]> on 2012-06-19
Reviewed by Adam Barth.

Add implementation for JSDictionary::convertValue(Vector<String>& result)
so that IDBDatabase::createObjectStore() compiles with JSC.

Tests: storage/indexeddb

* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
(WebCore):
* bindings/js/JSDictionary.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (120718 => 120719)


--- trunk/Source/WebCore/ChangeLog	2012-06-19 15:45:05 UTC (rev 120718)
+++ trunk/Source/WebCore/ChangeLog	2012-06-19 15:47:29 UTC (rev 120719)
@@ -1,3 +1,20 @@
+2012-06-19  Christophe Dumez  <[email protected]>
+
+        [JSC] Implement support for JSDictionary::convertValue(Vector<String>& result)
+        https://bugs.webkit.org/show_bug.cgi?id=89447
+
+        Reviewed by Adam Barth.
+
+        Add implementation for JSDictionary::convertValue(Vector<String>& result)
+        so that IDBDatabase::createObjectStore() compiles with JSC.
+
+        Tests: storage/indexeddb
+
+        * bindings/js/JSDictionary.cpp:
+        (WebCore::JSDictionary::convertValue):
+        (WebCore):
+        * bindings/js/JSDictionary.h:
+
 2012-06-19  Andy Estes  <[email protected]>
 
         [Mac] AudioFileReader::createBus() leaks an AudioBufferList if ExtAudioFileRead() returns an error

Modified: trunk/Source/WebCore/bindings/js/JSDictionary.cpp (120718 => 120719)


--- trunk/Source/WebCore/bindings/js/JSDictionary.cpp	2012-06-19 15:45:05 UTC (rev 120718)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.cpp	2012-06-19 15:47:29 UTC (rev 120719)
@@ -102,6 +102,24 @@
     result = ustringToString(value.toString(exec)->value(exec));
 }
 
+void JSDictionary::convertValue(ExecState* exec, JSValue value, Vector<String>& result)
+{
+    if (value.isUndefinedOrNull())
+        return;
+
+    unsigned length;
+    JSObject* object = toJSSequence(exec, value, length);
+    if (exec->hadException())
+        return;
+
+    for (unsigned i = 0 ; i < length; ++i) {
+        JSValue itemValue = object->get(exec, i);
+        if (exec->hadException())
+            return;
+        result.append(ustringToString(itemValue.toString(exec)->value(exec)));
+    }
+}
+
 void JSDictionary::convertValue(ExecState* exec, JSValue value, ScriptValue& result)
 {
     result = ScriptValue(exec->globalData(), value);

Modified: trunk/Source/WebCore/bindings/js/JSDictionary.h (120718 => 120719)


--- trunk/Source/WebCore/bindings/js/JSDictionary.h	2012-06-19 15:45:05 UTC (rev 120718)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.h	2012-06-19 15:47:29 UTC (rev 120719)
@@ -92,6 +92,7 @@
     static void convertValue(JSC::ExecState*, JSC::JSValue, Dictionary& result);
     static void convertValue(JSC::ExecState*, JSC::JSValue, String& result);
     static void convertValue(JSC::ExecState*, JSC::JSValue, ScriptValue& result);
+    static void convertValue(JSC::ExecState*, JSC::JSValue, Vector<String>& result);
     static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<SerializedScriptValue>& result);
     static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<DOMWindow>& result);
     static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<EventTarget>& result);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to