[gjs] dbus: Restore the previous behavior of returning undefined



commit f8143c75ef136c0040589f3d9aa16f8931c87406
Author: Johan Bilien <jobi litl com>
Date:   Fri Sep 17 23:53:46 2010 +0000

    dbus: Restore the previous behavior of returning undefined
    
    for methods with an empty out signature.
    
    I broke this with https://bugzilla.gnome.org/show_bug.cgi?id=629965
    
    https://bugzilla.gnome.org/show_bug.cgi?id=629967

 modules/dbus.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/modules/dbus.c b/modules/dbus.c
index 2322a7c..2f4b928 100644
--- a/modules/dbus.c
+++ b/modules/dbus.c
@@ -252,7 +252,10 @@ complete_call(JSContext   *context,
     g_assert(ret_values != NULL);
 
     array_length = gjs_rooted_array_get_length(context, ret_values);
-    if (array_length == 1) {
+    if (array_length == 0) {
+        /* the callback expects to be called with callback(undefined, null) */
+        *retval = JSVAL_VOID;
+    } else if (array_length == 1) {
         /* If the array only has one element return that element alone */
         *retval = gjs_rooted_array_get(context,
                                           ret_values,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]