Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped...
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jun 2004 00:54:18 +0000 (00:54 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jun 2004 00:54:18 +0000 (00:54 +0000)
This turned out to be a show stopper for Dashboard.  We now
return Undefined() when nil is returned from a ObjC method
that returns an object type.

        Reviewed by Maciej.

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

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

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

index 2e0a2ccff0493d03d98939a186060425fefaae8f..c85093b9f6aee3852a21dbf6b023e29f2aaf7753 100644 (file)
@@ -1,3 +1,16 @@
+2004-06-16  Richard Williamson   <rjw@apple.com>
+
+       Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
+
+       This turned out to be a show stopper for Dashboard.  We now
+       return Undefined() when nil is returned from a ObjC method
+       that returns an object type.
+       
+        Reviewed by Maciej.
+
+        * bindings/objc/objc_utility.mm:
+        (KJS::Bindings::convertObjcValueToValue):
+
 === Safari-145 ===
 
 2004-06-15  Richard Williamson   <rjw@apple.com>
index 9ca994bb9a59d0b5e22f5dd15be7ea749b957bb4..5ee5f7dcaa44c51f4ad718fb9243164a9341d318 100644 (file)
@@ -204,6 +204,9 @@ Value KJS::Bindings::convertObjcValueToValue (KJS::ExecState *exec, void *buffer
                     WebScriptObject *jsobject = (WebScriptObject *)*obj;
                     aValue = Object([jsobject _imp]);
                 }
+                else if (*obj == 0) {
+                    return Undefined();
+                }
                 else {
                     aValue = Object(new RuntimeObjectImp(new ObjcInstance (*obj)));
                 }