Title: [133483] trunk/Source/WebCore
Revision
133483
Author
[email protected]
Date
2012-11-05 08:32:07 -0800 (Mon, 05 Nov 2012)

Log Message

Add a comment about a return value of IDBKey::toV8()
https://bugs.webkit.org/show_bug.cgi?id=101212

Reviewed by Adam Barth.

Although all other toV8(impl) return null when impl is 0,
IDBKey::toV8(impl) is expected to return undefined when impl is 0.
This patch adds a comment about it.

No tests.

* bindings/js/JSIDBKeyCustom.cpp:
(WebCore::toJS):
* bindings/v8/custom/V8IDBKeyCustom.cpp:
(WebCore::toV8):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (133482 => 133483)


--- trunk/Source/WebCore/ChangeLog	2012-11-05 16:23:48 UTC (rev 133482)
+++ trunk/Source/WebCore/ChangeLog	2012-11-05 16:32:07 UTC (rev 133483)
@@ -1,3 +1,21 @@
+2012-11-05  Kentaro Hara  <[email protected]>
+
+        Add a comment about a return value of IDBKey::toV8()
+        https://bugs.webkit.org/show_bug.cgi?id=101212
+
+        Reviewed by Adam Barth.
+
+        Although all other toV8(impl) return null when impl is 0,
+        IDBKey::toV8(impl) is expected to return undefined when impl is 0.
+        This patch adds a comment about it.
+
+        No tests.
+
+        * bindings/js/JSIDBKeyCustom.cpp:
+        (WebCore::toJS):
+        * bindings/v8/custom/V8IDBKeyCustom.cpp:
+        (WebCore::toV8):
+
 2012-11-05  Dominik Röttsches  <[email protected]>
 
         [Cairo] Make Cairo honor image orientation

Modified: trunk/Source/WebCore/bindings/js/JSIDBKeyCustom.cpp (133482 => 133483)


--- trunk/Source/WebCore/bindings/js/JSIDBKeyCustom.cpp	2012-11-05 16:23:48 UTC (rev 133482)
+++ trunk/Source/WebCore/bindings/js/JSIDBKeyCustom.cpp	2012-11-05 16:32:07 UTC (rev 133483)
@@ -39,8 +39,11 @@
 
 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, IDBKey* key)
 {
-    if (!key)
+    if (!key) {
+        // This should be undefined, not null.
+        // Spec: http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBKeyRange
         return jsUndefined();
+    }
 
     switch (key->type()) {
     case IDBKey::ArrayType:

Modified: trunk/Source/WebCore/bindings/v8/custom/V8IDBKeyCustom.cpp (133482 => 133483)


--- trunk/Source/WebCore/bindings/v8/custom/V8IDBKeyCustom.cpp	2012-11-05 16:23:48 UTC (rev 133482)
+++ trunk/Source/WebCore/bindings/v8/custom/V8IDBKeyCustom.cpp	2012-11-05 16:32:07 UTC (rev 133483)
@@ -40,8 +40,11 @@
 
 v8::Handle<v8::Value> toV8(IDBKey* key, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
-    if (!key)
+    if (!key) {
+        // This should be undefined, not null.
+        // Spec: http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBKeyRange
         return v8Undefined();
+    }
 
     switch (key->type()) {
     case IDBKey::InvalidType:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to