Moved boolean checks prior to NSNumber checks. booleans are
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Oct 2004 21:40:47 +0000 (21:40 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Oct 2004 21:40:47 +0000 (21:40 +0000)
NSNumbers.

Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.

        Reviewed by John.

        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertObjcValueToValue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7827 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/bindings/objc/objc_utility.mm

index 8497d28975bfab7e55364c094de8c1ef565f4328..3721a321d95012942ecfbf9edd88ae77c453f1ab 100644 (file)
@@ -1,3 +1,15 @@
+2004-10-13  Richard Williamson   <rjw@apple.com>
+
+       Moved boolean checks prior to NSNumber checks.  booleans are
+       NSNumbers.
+
+       Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
+
+        Reviewed by John.
+
+        * bindings/objc/objc_utility.mm:
+        (KJS::Bindings::convertObjcValueToValue):
+
 2004-10-12  Richard Williamson   <rjw@apple.com>
 
         Fixed access to DOM object via WebScriptObject API.
index b902929bc0f6eece81c1823e6883e11ae979375f..313f6520a90b929b12ef7dbc83e04373782679f6 100644 (file)
@@ -194,6 +194,12 @@ Value KJS::Bindings::convertObjcValueToValue (KJS::ExecState *exec, void *buffer
                     aValue = String (u);
                     free((void *)chars);
                 }
+                else if ((CFBooleanRef)*obj == kCFBooleanTrue) {
+                    aValue = Boolean(true);
+                }
+                else if ((CFBooleanRef)*obj == kCFBooleanFalse) {
+                    aValue = Boolean(false);
+                }
                 else if ([*obj isKindOfClass:[NSNumber class]]) {
                     aValue = Number([*obj doubleValue]);
                 }
@@ -204,12 +210,6 @@ Value KJS::Bindings::convertObjcValueToValue (KJS::ExecState *exec, void *buffer
                     WebScriptObject *jsobject = (WebScriptObject *)*obj;
                     aValue = Object([jsobject _imp]);
                 }
-                else if ((CFBooleanRef)*obj == kCFBooleanTrue) {
-                    aValue = Boolean(true);
-                }
-                else if ((CFBooleanRef)*obj == kCFBooleanFalse) {
-                    aValue = Boolean(false);
-                }
                 else if (*obj == 0) {
                     return Undefined();
                 }