summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-09-16 19:40:11 -0400
committerOwen W. Taylor <otaylor@fishsoup.net>2010-09-30 10:47:38 -0400
commit52084e1821d7120c1af2de627bf146758d0aacfd (patch)
treea42b82bf52723e928adaf575ca9d8a8fd4f8598f
parent48de8e53d4965d0a0e418a3bddd84e462f934cb1 (diff)
downloadgjs-52084e1821d7120c1af2de627bf146758d0aacfd.tar.gz
xulrunner 1.9.3: Fix assumption that jsid == jsval
The two have always been conceptually distinct types. Even in 1.9.3, they are still the same in implementation, but to avoid a pile of warnings, we should avoid confusing them. Unfortunately, even the SpiderMonkey docs are wrong in a few places, so gjs' code confusing them is understandable. Anyways, fix up places that made this assumption.
-rw-r--r--gi/arg.c6
-rw-r--r--gi/boxed.c30
-rw-r--r--gi/function.c4
-rw-r--r--gi/ns.c4
-rw-r--r--gi/object.c28
-rw-r--r--gi/param.c8
-rw-r--r--gi/repo.c4
-rw-r--r--gi/union.c4
-rw-r--r--gjs/byteArray.c40
-rw-r--r--gjs/compat.h12
-rw-r--r--gjs/importer.c16
-rw-r--r--gjs/jsapi-util-string.c11
-rw-r--r--gjs/jsapi-util.c14
-rw-r--r--gjs/jsapi-util.h3
-rw-r--r--modules/dbus-exports.c10
-rw-r--r--modules/dbus-values.c6
-rw-r--r--modules/dbus.c7
17 files changed, 114 insertions, 93 deletions
diff --git a/gi/arg.c b/gi/arg.c
index 90357314..4241a80c 100644
--- a/gi/arg.c
+++ b/gi/arg.c
@@ -299,7 +299,7 @@ gjs_object_to_g_hash(JSContext *context,
if (iter == NULL)
return JS_FALSE;
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, iter, &prop_id))
return JS_FALSE;
@@ -308,7 +308,7 @@ gjs_object_to_g_hash(JSContext *context,
* Rely on the type-aware g_argument_release functions. */
result = g_hash_table_new(g_str_hash, g_str_equal);
- while (prop_id != JSVAL_VOID) {
+ while (!JSID_IS_VOID(prop_id)) {
jsval key_js, val_js;
GArgument key_arg, val_arg;
@@ -341,7 +341,7 @@ gjs_object_to_g_hash(JSContext *context,
g_hash_table_insert(result, key_arg.v_pointer, val_arg.v_pointer);
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, iter, &prop_id))
goto free_hash_and_fail;
}
diff --git a/gi/boxed.c b/gi/boxed.c
index 4fb93c79..b85ec2a5 100644
--- a/gi/boxed.c
+++ b/gi/boxed.c
@@ -84,7 +84,7 @@ GJS_DEFINE_DYNAMIC_PRIV_FROM_JS(Boxed, gjs_boxed_class)
static JSBool
boxed_new_resolve(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
uintN flags,
JSObject **objp)
{
@@ -93,7 +93,7 @@ boxed_new_resolve(JSContext *context,
*objp = NULL;
- if (!gjs_get_string_id(id, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
priv = priv_from_js(context, obj);
@@ -328,20 +328,16 @@ boxed_init_from_props(JSContext *context,
field_map = get_field_map(priv->info);
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, iter, &prop_id))
goto out;
- while (prop_id != JSVAL_VOID) {
+ while (!JSID_IS_VOID(prop_id)) {
GIFieldInfo *field_info;
- jsval nameval;
const char *name;
jsval value;
- if (!JS_IdToValue(context, prop_id, &nameval))
- goto out;
-
- if (!gjs_get_string_id(nameval, &name))
+ if (!gjs_get_string_id(context, prop_id, &name))
goto out;
field_info = g_hash_table_lookup(field_map, name);
@@ -358,7 +354,7 @@ boxed_init_from_props(JSContext *context,
goto out;
}
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, iter, &prop_id))
goto out;
}
@@ -592,17 +588,21 @@ boxed_finalize(JSContext *context,
static GIFieldInfo *
get_field_info (JSContext *context,
Boxed *priv,
- jsval id)
+ jsid id)
{
int field_index;
+ jsval id_val;
+
+ if (!JS_IdToValue(context, id, &id_val))
+ return JS_FALSE;
- if (!JSVAL_IS_INT (id)) {
+ if (!JSVAL_IS_INT (id_val)) {
gjs_throw(context, "Field index for %s is not an integer",
g_base_info_get_name ((GIBaseInfo *)priv->info));
return NULL;
}
- field_index = JSVAL_TO_INT(id);
+ field_index = JSVAL_TO_INT(id_val);
if (field_index < 0 || field_index >= g_struct_info_get_n_fields (priv->info)) {
gjs_throw(context, "Bad field index %d for %s", field_index,
g_base_info_get_name ((GIBaseInfo *)priv->info));
@@ -661,7 +661,7 @@ get_nested_interface_object (JSContext *context,
static JSBool
boxed_field_getter (JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value)
{
Boxed *priv;
@@ -840,7 +840,7 @@ out:
static JSBool
boxed_field_setter (JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value)
{
Boxed *priv;
diff --git a/gi/function.c b/gi/function.c
index 2b908e3f..11324846 100644
--- a/gi/function.c
+++ b/gi/function.c
@@ -103,7 +103,7 @@ GJS_DEFINE_PRIV_FROM_JS(Function, gjs_function_class)
static JSBool
function_new_resolve(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
uintN flags,
JSObject **objp)
{
@@ -112,7 +112,7 @@ function_new_resolve(JSContext *context,
*objp = NULL;
- if (!gjs_get_string_id(id, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
priv = priv_from_js(context, obj);
diff --git a/gi/ns.c b/gi/ns.c
index 84d09ede..df2e4b2e 100644
--- a/gi/ns.c
+++ b/gi/ns.c
@@ -63,7 +63,7 @@ GJS_DEFINE_PRIV_FROM_JS(Ns, gjs_ns_class)
static JSBool
ns_new_resolve(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
uintN flags,
JSObject **objp)
{
@@ -75,7 +75,7 @@ ns_new_resolve(JSContext *context,
*objp = NULL;
- if (!gjs_get_string_id(id, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
/* let Object.prototype resolve these */
diff --git a/gi/object.c b/gi/object.c
index 7a0acfb7..e5a3d0c7 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -121,7 +121,7 @@ init_g_param_from_property(JSContext *context,
static JSBool
object_instance_get_prop(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value_p)
{
ObjectInstance *priv;
@@ -130,7 +130,7 @@ object_instance_get_prop(JSContext *context,
GParamSpec *param;
GValue gvalue = { 0, };
- if (!gjs_get_string_id(id, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
priv = priv_from_js(context, obj);
@@ -178,14 +178,14 @@ object_instance_get_prop(JSContext *context,
static JSBool
object_instance_set_prop(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value_p)
{
ObjectInstance *priv;
const char *name;
GParameter param = { NULL, { 0, }};
- if (!gjs_get_string_id(id, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
priv = priv_from_js(context, obj);
@@ -239,7 +239,7 @@ object_instance_set_prop(JSContext *context,
static JSBool
object_instance_new_resolve(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
uintN flags,
JSObject **objp)
{
@@ -248,7 +248,7 @@ object_instance_new_resolve(JSContext *context,
*objp = NULL;
- if (!gjs_get_string_id(id, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
priv = priv_from_js(context, obj);
@@ -459,27 +459,23 @@ object_instance_props_to_g_parameters(JSContext *context,
return JS_FALSE;
}
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, iter, &prop_id))
return JS_FALSE;
- if (prop_id != JSVAL_VOID) {
+ if (!JSID_IS_VOID(prop_id)) {
gparams = g_array_new(/* nul term */ FALSE, /* clear */ TRUE,
sizeof(GParameter));
} else {
return JS_TRUE;
}
- while (prop_id != JSVAL_VOID) {
- jsval nameval;
+ while (!JSID_IS_VOID(prop_id)) {
const char *name;
jsval value;
GParameter gparam = { NULL, { 0, }};
- if (!JS_IdToValue(context, prop_id, &nameval))
- goto free_array_and_fail;
-
- if (!gjs_get_string_id(nameval, &name))
+ if (!gjs_get_string_id(context, prop_id, &name))
goto free_array_and_fail;
if (!gjs_object_require_property(context, props, "property list", name, &value))
@@ -501,7 +497,7 @@ object_instance_props_to_g_parameters(JSContext *context,
g_array_append_val(gparams, gparam);
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, iter, &prop_id))
goto free_array_and_fail;
}
@@ -859,7 +855,7 @@ real_connect_func(JSContext *context,
const char *signal_name;
GQuark signal_detail;
- *retval = INT_TO_JSVAL(0);
+ *retval = JSID_VOID;
priv = priv_from_js(context, obj);
gjs_debug_gsignal("connect obj %p priv %p argc %d", obj, priv, argc);
diff --git a/gi/param.c b/gi/param.c
index 0a168489..dec875f4 100644
--- a/gi/param.c
+++ b/gi/param.c
@@ -50,14 +50,14 @@ GJS_DEFINE_DYNAMIC_PRIV_FROM_JS(Param, gjs_param_class)
static JSBool
param_get_prop(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value_p)
{
Param *priv;
const char *name;
const char *value_str;
- if (!gjs_get_string_id(id, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not something we affect, but no error */
priv = priv_from_js(context, obj);
@@ -99,7 +99,7 @@ param_get_prop(JSContext *context,
static JSBool
param_new_resolve(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
uintN flags,
JSObject **objp)
{
@@ -108,7 +108,7 @@ param_new_resolve(JSContext *context,
*objp = NULL;
- if (!gjs_get_string_id(id, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
priv = priv_from_js(context, obj);
diff --git a/gi/repo.c b/gi/repo.c
index bb215bb7..adecae94 100644
--- a/gi/repo.c
+++ b/gi/repo.c
@@ -124,7 +124,7 @@ resolve_namespace_object(JSContext *context,
static JSBool
repo_new_resolve(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
uintN flags,
JSObject **objp)
{
@@ -134,7 +134,7 @@ repo_new_resolve(JSContext *context,
*objp = NULL;
- if (!gjs_get_string_id(id, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
/* let Object.prototype resolve these */
diff --git a/gi/union.c b/gi/union.c
index 77c70ce6..1cf74a72 100644
--- a/gi/union.c
+++ b/gi/union.c
@@ -68,7 +68,7 @@ GJS_DEFINE_DYNAMIC_PRIV_FROM_JS(Union, gjs_union_class)
static JSBool
union_new_resolve(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
uintN flags,
JSObject **objp)
{
@@ -77,7 +77,7 @@ union_new_resolve(JSContext *context,
*objp = NULL;
- if (!gjs_get_string_id(id, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
priv = priv_from_js(context, obj);
diff --git a/gjs/byteArray.c b/gjs/byteArray.c
index bf0a7d88..7924233e 100644
--- a/gjs/byteArray.c
+++ b/gjs/byteArray.c
@@ -40,15 +40,15 @@ GJS_DEFINE_PRIV_FROM_JS(ByteArrayInstance, gjs_byte_array_class)
static JSBool byte_array_get_prop (JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value_p);
static JSBool byte_array_set_prop (JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value_p);
static JSBool byte_array_new_resolve (JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
uintN flags,
JSObject **objp);
static JSBool byte_array_constructor (JSContext *context,
@@ -187,10 +187,11 @@ byte_array_get_index(JSContext *context,
static JSBool
byte_array_get_prop(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value_p)
{
ByteArrayInstance *priv;
+ jsval id_value;
priv = priv_from_js(context, obj);
@@ -199,10 +200,13 @@ byte_array_get_prop(JSContext *context,
if (priv->array == NULL)
return JS_TRUE; /* prototype, not an instance. */
+ if (!JS_IdToValue(context, id, &id_value))
+ return JS_FALSE;
+
/* First handle array indexing */
- if (JSVAL_IS_NUMBER(id)) {
+ if (JSVAL_IS_NUMBER(id_value)) {
gsize idx;
- if (!gjs_value_to_gsize(context, id, &idx))
+ if (!gjs_value_to_gsize(context, id_value, &idx))
return JS_FALSE;
return byte_array_get_index(context, obj, priv, idx, value_p);
}
@@ -217,7 +221,7 @@ byte_array_get_prop(JSContext *context,
static JSBool
byte_array_length_getter(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value_p)
{
ByteArrayInstance *priv;
@@ -236,7 +240,7 @@ byte_array_length_getter(JSContext *context,
static JSBool
byte_array_length_setter(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value_p)
{
ByteArrayInstance *priv;
@@ -295,10 +299,11 @@ byte_array_set_index(JSContext *context,
static JSBool
byte_array_set_prop(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value_p)
{
ByteArrayInstance *priv;
+ jsval id_value;
priv = priv_from_js(context, obj);
@@ -307,10 +312,13 @@ byte_array_set_prop(JSContext *context,
if (priv->array == NULL)
return JS_TRUE; /* prototype, not an instance. */
+ if (!JS_IdToValue(context, id, &id_value))
+ return JS_FALSE;
+
/* First handle array indexing */
- if (JSVAL_IS_NUMBER(id)) {
+ if (JSVAL_IS_NUMBER(id_value)) {
gsize idx;
- if (!gjs_value_to_gsize(context, id, &idx))
+ if (!gjs_value_to_gsize(context, id_value, &idx))
return JS_FALSE;
return byte_array_set_index(context, obj, priv, idx, value_p);
@@ -345,11 +353,12 @@ byte_array_set_prop(JSContext *context,
static JSBool
byte_array_new_resolve(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
uintN flags,
JSObject **objp)
{
ByteArrayInstance *priv;
+ jsval id_val;
priv = priv_from_js(context, *objp);
@@ -358,9 +367,12 @@ byte_array_new_resolve(JSContext *context,
if (priv->array == NULL)
return JS_TRUE; /* prototype, not an instance. */
- if (JSVAL_IS_NUMBER(id)) {
+ if (!JS_IdToValue(context, id, &id_val))
+ return JS_FALSE;
+
+ if (JSVAL_IS_NUMBER(id_val)) {
gsize idx;
- if (!gjs_value_to_gsize(context, id, &idx))
+ if (!gjs_value_to_gsize(context, id_val, &idx))
return JS_FALSE;
if (idx >= priv->array->len) {
*objp = NULL;
diff --git a/gjs/compat.h b/gjs/compat.h
index 6e226260..226018cb 100644
--- a/gjs/compat.h
+++ b/gjs/compat.h
@@ -39,6 +39,10 @@ G_BEGIN_DECLS
/* See https://bugzilla.gnome.org/show_bug.cgi?id=622896 */
#ifndef HAVE_JS_ADDVALUEROOT
+
+/* The old JS_AddRoot accepted anything via void *, new
+ * api is stricter.
+ */
#define JS_AddValueRoot JS_AddRoot
#define JS_AddObjectRoot JS_AddRoot
#define JS_AddStringRoot JS_AddRoot
@@ -47,6 +51,14 @@ G_BEGIN_DECLS
#define JS_RemoveObjectRoot JS_RemoveRoot
#define JS_RemoveStringRoot JS_RemoveRoot
#define JS_RemoveGCThingRoot JS_RemoveRoot
+
+/* This one is complex; jsid appears to be explicitly
+ * different from JSVAL now. If we're on an old xulrunner,
+ * define JSID_IS_VOID in a simple way.
+ */
+#define JSID_VOID JSVAL_VOID
+#define JSID_IS_VOID(id) (id == JSVAL_VOID)
+
#endif
G_END_DECLS
diff --git a/gjs/importer.c b/gjs/importer.c
index 81b87e41..ee42b480 100644
--- a/gjs/importer.c
+++ b/gjs/importer.c
@@ -361,15 +361,10 @@ load_module_elements(JSContext *context,
return;
}
- while (idp != JSVAL_VOID) {
- jsval nameval;
+ while (!JSID_IS_VOID(idp)) {
const char *name;
- if (!JS_IdToValue(context, idp, &nameval)) {
- continue;
- }
-
- if (!gjs_get_string_id(nameval, &name)) {
+ if (!gjs_get_string_id(context, idp, &name)) {
continue;
}
@@ -740,7 +735,7 @@ importer_new_enumerate(JSContext *context,
*state_p = JSVAL_NULL;
if (id_p)
- *id_p = JSVAL_ZERO;
+ *id_p = JSID_VOID;
priv = priv_from_js(context, object);
if (!priv)
@@ -908,7 +903,7 @@ importer_new_enumerate(JSContext *context,
static JSBool
importer_new_resolve(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
uintN flags,
JSObject **objp)
{
@@ -918,7 +913,8 @@ importer_new_resolve(JSContext *context,
*objp = NULL;
- name = gjs_string_get_ascii(id);
+ if (!gjs_get_string_id(context, id, &name))
+ return JS_FALSE;
/* let Object.prototype resolve these */
if (strcmp(name, "valueOf") == 0 ||
diff --git a/gjs/jsapi-util-string.c b/gjs/jsapi-util-string.c
index e7caae0c..e4a89487 100644
--- a/gjs/jsapi-util-string.c
+++ b/gjs/jsapi-util-string.c
@@ -421,7 +421,8 @@ gjs_string_get_uint16_data(JSContext *context,
/**
* gjs_get_string_id:
- * @id_val: a jsval that is an object hash key (could be an int or string)
+ * @context: a #JSContext
+ * @id: a jsid that is an object hash key (could be an int or string)
* @name_p place to store ASCII string version of key
*
* If the id is not a string ID, return false and set *name_p to %NULL.
@@ -430,9 +431,15 @@ gjs_string_get_uint16_data(JSContext *context,
* Returns: true if *name_p is non-%NULL
**/
JSBool
-gjs_get_string_id (jsval id_val,
+gjs_get_string_id (JSContext *context,
+ jsid id,
const char **name_p)
{
+ jsval id_val;
+
+ if (!JS_IdToValue(context, id, &id_val))
+ return JS_FALSE;
+
if (JSVAL_IS_STRING(id_val)) {
*name_p = JS_GetStringBytes(JSVAL_TO_STRING(id_val));
return JS_TRUE;
diff --git a/gjs/jsapi-util.c b/gjs/jsapi-util.c
index aea99cbf..2abe49e7 100644
--- a/gjs/jsapi-util.c
+++ b/gjs/jsapi-util.c
@@ -696,19 +696,15 @@ gjs_log_object_props(JSContext *context,
goto done;
}
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, props_iter, &prop_id))
goto done;
- while (prop_id != JSVAL_VOID) {
- jsval nameval;
- const char *name;
+ while (!JSID_IS_VOID(prop_id)) {
jsval propval;
+ const char *name;
- if (!JS_IdToValue(context, prop_id, &nameval))
- goto next;
-
- if (!gjs_get_string_id(nameval, &name))
+ if (!gjs_get_string_id(context, prop_id, &name))
goto next;
if (!gjs_object_get_property(context, obj, name, &propval))
@@ -720,7 +716,7 @@ gjs_log_object_props(JSContext *context,
gjs_value_debug_string(context, propval));
next:
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, props_iter, &prop_id))
break;
}
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h
index 9921805e..39b782af 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -331,7 +331,8 @@ JSBool gjs_string_get_uint16_data (JSContext *context,
jsval value,
guint16 **data_p,
gsize *len_p);
-JSBool gjs_get_string_id (jsval id_val,
+JSBool gjs_get_string_id (JSContext *context,
+ jsid id,
const char **name_p);
const char* gjs_get_type_name (jsval value);
diff --git a/modules/dbus-exports.c b/modules/dbus-exports.c
index 2938d73a..e0f63977 100644
--- a/modules/dbus-exports.c
+++ b/modules/dbus-exports.c
@@ -1408,14 +1408,14 @@ handle_introspect(JSContext *context,
JS_AddStringRoot(context, &key_str);
props_iter = JS_NewPropertyIterator(context, dir_obj);
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, props_iter, &prop_id)) {
gjs_debug(GJS_DEBUG_DBUS,
"Failed to get next property iterating dbus directory");
goto out;
}
- while (prop_id != JSVAL_VOID) {
+ while (!JSID_IS_VOID(prop_id)) {
char *key;
jsval keyval;
jsval valueval = JSVAL_VOID;
@@ -1455,7 +1455,7 @@ handle_introspect(JSContext *context,
key);
}
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, props_iter, &prop_id)) {
gjs_debug(GJS_DEBUG_DBUS,
"Failed to get next property iterating dbus object");
@@ -1660,7 +1660,7 @@ on_message(DBusConnection *connection,
static JSBool
exports_new_resolve(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
uintN flags,
JSObject **objp)
{
@@ -1669,7 +1669,7 @@ exports_new_resolve(JSContext *context,
*objp = NULL;
- if (!gjs_get_string_id(id, &name))
+ if (!gjs_get_string_id(context, id, &name))
return JS_TRUE; /* not resolved, but no error */
priv = priv_from_js(context, obj);
diff --git a/modules/dbus-values.c b/modules/dbus-values.c
index 31f6424c..4519f934 100644
--- a/modules/dbus-values.c
+++ b/modules/dbus-values.c
@@ -776,11 +776,11 @@ append_dict(JSContext *context,
return JS_FALSE;
}
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, props_iter, &prop_id))
return JS_FALSE;
- while (prop_id != JSVAL_VOID) {
+ while (!JSID_IS_VOID(prop_id)) {
jsval nameval;
char *name;
jsval propval;
@@ -864,7 +864,7 @@ append_dict(JSContext *context,
dbus_message_iter_close_container(&dict_iter, &entry_iter);
next:
- prop_id = JSVAL_VOID;
+ prop_id = JSID_VOID;
if (!JS_NextProperty(context, props_iter, &prop_id))
return JS_FALSE;
}
diff --git a/modules/dbus.c b/modules/dbus.c
index d7178346..b0bf2d69 100644
--- a/modules/dbus.c
+++ b/modules/dbus.c
@@ -1413,7 +1413,7 @@ gjs_js_dbus_watch_name(JSContext *context,
static JSBool
unique_name_getter(JSContext *context,
JSObject *obj,
- jsval id,
+ jsid id,
jsval *value_p)
{
const char *name;
@@ -1423,7 +1423,8 @@ unique_name_getter(JSContext *context,
if (!get_bus_type_from_object(context, obj, &bus_type))
return JS_FALSE;
- name = gjs_string_get_ascii(id);
+ if (!gjs_get_string_id(context, id, &name))
+ return JS_FALSE;
gjs_debug_jsprop(GJS_DEBUG_DBUS, "Get prop '%s' on dbus object", name);
@@ -1523,7 +1524,7 @@ gjs_js_dbus_start_service(JSContext *context,
static JSBool
gjs_js_dbus_get_machine_id(JSContext *context,
JSObject *obj,
- jsval key,
+ jsid key,
jsval *value)
{
char *machine_id;