summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-09-21 10:55:22 -0400
committerColin Walters <walters@verbum.org>2010-09-23 15:00:30 -0400
commitbefa94438f269ce48dcf1f0d1264005bf3391084 (patch)
treedfd0404b23d1281897786a909c10bb3de1949ee8
parent2b974e3b3ef1fc31416b483735f40a788ca5c51c (diff)
downloadgjs-befa94438f269ce48dcf1f0d1264005bf3391084.tar.gz
dbus: Use separate SetPrototype() call
In XULRunner 1.9.3, passing a custom prototype to JS_ConstructObject for Object seems to fail; from a reading of the code, what's happening is the Object constructor is overriding it.
-rw-r--r--modules/dbus.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/dbus.c b/modules/dbus.c
index b0bf2d69..01a6154d 100644
--- a/modules/dbus.c
+++ b/modules/dbus.c
@@ -1738,9 +1738,15 @@ define_bus_object(JSContext *context,
bus_val = JSVAL_VOID;
JS_AddValueRoot(context, &bus_val);
- bus_obj = JS_ConstructObject(context, NULL, proto_obj, NULL);
+ bus_obj = JS_ConstructObject(context, NULL, NULL, NULL);
if (bus_obj == NULL)
goto out;
+ /* Separate SetPrototype call since mixing custom prototype with
+ * Object class in ConstructObject seems to fail in 1.9.3.
+ * Really, we should actually be using a custom class for internal
+ * objects like this.
+ */
+ JS_SetPrototype(context, bus_obj, proto_obj);
bus_val = OBJECT_TO_JSVAL(bus_obj);