Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined...
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Nov 2004 22:33:14 +0000 (22:33 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Nov 2004 22:33:14 +0000 (22:33 +0000)
        Reviewed by John.

        * ChangeLog:
        * bindings/objc/WebScriptObject.mm:
        (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
Added additional conversion Undefined -> WebUndefined.
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertObjcValueToValue):
Added additional conversion WebUndefined -> Undefined.

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

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

index 145d960..1678473 100644 (file)
@@ -1,3 +1,25 @@
+2004-11-01  Richard Williamson   <rjw@apple.com>
+
+        Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
+
+        Reviewed by John.
+
+        * ChangeLog:
+        * bindings/objc/WebScriptObject.mm:
+        (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
+       Added additional conversion Undefined -> WebUndefined.
+        * bindings/objc/objc_utility.mm:
+        (KJS::Bindings::convertObjcValueToValue):
+       Added additional conversion WebUndefined -> Undefined.
+
+2004-11-01  Richard Williamson   <rjw@apple.com>
+
+
+        Reviewed by John.
+
+        * bindings/objc/WebScriptObject.mm:
+        (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
+
 2004-11-01  Darin Adler  <darin@apple.com>
 
         - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
index 690c599..ee6ec09 100644 (file)
@@ -393,6 +393,13 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
         result = [NSNumber numberWithBool:b->value()];
     }
     
+    // Convert JavaScript Undefined types to WebUndefined
+    else if (value.type() == KJS::UndefinedType) {
+        result = [WebUndefined undefined];
+    }
+    
+    // Other types (UnspecifiedType and NullType) converted to 0.
+    
     return result;
 }
 
index 313f652..85c64c5 100644 (file)
@@ -194,6 +194,9 @@ Value KJS::Bindings::convertObjcValueToValue (KJS::ExecState *exec, void *buffer
                     aValue = String (u);
                     free((void *)chars);
                 }
+                else if (*obj == [WebUndefined undefined]) {
+                    return Undefined();
+                }
                 else if ((CFBooleanRef)*obj == kCFBooleanTrue) {
                     aValue = Boolean(true);
                 }