GNOME Bugzilla – Bug 604023
Allow any basic type to be used as the key in a dbus dict
Last modified: 2009-12-08 20:04:23 UTC
Telepathy has a method with return type a{us}. gjs doesn't like this because the key type isn't 's', but there's no real reason it couldn't just toString() the key in this case, and it would all just work from the js side. I'm not totally sure the memory management here is correct because I'm not familiar with spidermonkey. (I just copied code that was used in other places in gjs.)
Created attachment 149295 [details] [review] Allow any basic type to be used as the key in a dbus dict
Review of attachment 149295 [details] [review]: Rest looks quite good to me. ::: modules/dbus-values.c @@ +119,3 @@ + if (!gjs_js_one_value_from_dbus(context, &entry_iter, &key_value)) { + JS_AddRoot(context, &entry_value); + entry_value = JSVAL_VOID; You should probably call JS_AddRoot upon this as well, to protect it from being GC:ed.
fixed and pushed Attachment 149295 [details] pushed as 3c094bb - Allow any basic type to be used as the key in a dbus dict