diff options
author | Johan Bilien <jobi@litl.com> | 2010-09-17 23:53:46 +0000 |
---|---|---|
committer | Johan Bilien <jobi@litl.com> | 2010-09-17 19:55:18 -0400 |
commit | f8143c75ef136c0040589f3d9aa16f8931c87406 (patch) | |
tree | dfe59e20900cad9f0cb611a26e6e0c04e5b9a636 | |
parent | 21e25e643acce5f6641fa06b862a370ca0cbf9e2 (diff) | |
download | gjs-f8143c75ef136c0040589f3d9aa16f8931c87406.tar.gz |
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
-rw-r--r-- | modules/dbus.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/dbus.c b/modules/dbus.c index 2322a7c3..2f4b928d 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, |