[gjs/wip/xulrunner-1.9.3-rebase4: 14/16] dbus: Unset JSPROP_READONLY from _busProto
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/xulrunner-1.9.3-rebase4: 14/16] dbus: Unset JSPROP_READONLY from _busProto
- Date: Mon, 20 Sep 2010 22:26:57 +0000 (UTC)
commit 929fa966c0744c9480ad81101245129e537f9b6c
Author: Colin Walters <walters verbum org>
Date: Mon Sep 20 16:20:04 2010 -0400
dbus: Unset JSPROP_READONLY from _busProto
We do modify it inside dbus.js. Older spidermonkey seemed not
to care, but with xulrunner 1.9.3, modifications silently fail.
modules/dbus.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/modules/dbus.c b/modules/dbus.c
index b0bf2d6..0bf712f 100644
--- a/modules/dbus.c
+++ b/modules/dbus.c
@@ -1700,11 +1700,16 @@ define_bus_proto(JSContext *context,
1, GJS_MODULE_PROP_FLAGS))
goto out;
- /* Add the bus proto object inside the passed in module object */
+ /* Add the bus proto object inside the passed in module object.
+ * Note we explicitly set the flags, rather than using the
+ * standard GJS_MODULE_PROP_FLAGS. The latter includes
+ * JSPROP_READONLY, which doesn't work since dbus.js adds
+ * attributes to this property.
+ */
if (!JS_DefineProperty(context, module_obj,
"_busProto", OBJECT_TO_JSVAL(bus_proto_obj),
NULL, NULL,
- GJS_MODULE_PROP_FLAGS))
+ JSPROP_PERMANENT | JSPROP_ENUMERATE))
goto out;
*bus_proto_obj_out = bus_proto_obj;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]