Fix return type conversions from Qt slots to JS values.
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2008 10:54:52 +0000 (10:54 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2008 10:54:52 +0000 (10:54 +0000)
This also fixes fast/dom/open-and-close-by-DOM.html, which called
layoutTestController.windowCount().

When constructing the QVariant that holds the return type we cannot
use the QVarian(Type) constuctor as that will create a null variant.
We have to use the QVariant(Type, void *) constructor instead, just
like in QMetaObject::read() for example.

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

JavaScriptCore/ChangeLog
JavaScriptCore/bindings/qt/qt_instance.cpp

index 4b0df45..8e4927a 100644 (file)
@@ -1,3 +1,21 @@
+2008-01-18  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Holger.
+
+        Fix return type conversions from Qt slots to JS values.
+        
+        This also fixes fast/dom/open-and-close-by-DOM.html, which called
+        layoutTestController.windowCount().
+        
+        When constructing the QVariant that holds the return type we cannot
+        use the QVarian(Type) constuctor as that will create a null variant.
+        We have to use the QVariant(Type, void *) constructor instead, just
+        like in QMetaObject::read() for example.
+        
+
+        * bindings/qt/qt_instance.cpp:
+        (KJS::Bindings::QtInstance::getRuntimeObject):
+
 2008-01-18  Prasanth Ullattil  <prasanth.ullattil@trolltech.com>
 
         Reviewed by Simon Hausmann <hausmann@webkit.org>.
index 294d282..c6eec0a 100644 (file)
@@ -168,7 +168,7 @@ JSValue* QtInstance::invokeMethod(ExecState* exec, const MethodList& methodList,
         qCritical("QtInstance::invokeMethod: Return type %s of method %s is not registered with QMetaType!", metaMethod.typeName(), metaMethod.signature());
         return jsUndefined();
     }
-    vargs[0] = QVariant(returnType);
+    vargs[0] = QVariant(returnType, (void*)0);
     qargs[0] = vargs[0].data();
 
     for (int i = 0; i < args.size(); ++i) {