[gjs/wip/ptomato/mozjs45: 9/25] js: new JS_Enumerate api
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/ptomato/mozjs45: 9/25] js: new JS_Enumerate api
- Date: Sat, 6 May 2017 06:27:05 +0000 (UTC)
commit bfaeab1886daf2458caf94b9a06d7ead3ac24d72
Author: Philip Chimento <philip chimento gmail com>
Date: Sun Mar 19 04:53:15 2017 +0000
js: new JS_Enumerate api
You now have to pass into JS_Enumerate() a rooted JS::IdVector for it to
fill in, rather than it returning a JSIdArray.
gi/arg.cpp | 4 ++--
gi/boxed.cpp | 5 ++---
gi/object.cpp | 4 ++--
gjs/importer.cpp | 4 ++--
4 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index 81ebf4d..c651bd5 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -502,8 +502,8 @@ gjs_object_to_g_hash(JSContext *context,
transfer = GI_TRANSFER_NOTHING;
}
- JS::AutoIdArray ids(context, JS_Enumerate(context, props));
- if (!ids)
+ JS::Rooted<JS::IdVector> ids(context, context);
+ if (!JS_Enumerate(context, props, &ids))
return false;
result = create_hash_table_for_key_type(key_param_info);
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index e6500d3..938c78b 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -269,9 +269,8 @@ boxed_init_from_props(JSContext *context,
}
JS::RootedObject props(context, &props_value.toObject());
- JS::AutoIdArray ids(context, JS_Enumerate(context, props));
-
- if (!ids) {
+ JS::Rooted<JS::IdVector> ids(context, context);
+ if (!JS_Enumerate(context, props, &ids)) {
gjs_throw(context, "Failed to enumerate fields hash");
return false;
}
diff --git a/gi/object.cpp b/gi/object.cpp
index d98c126..fd9ea6b 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -851,9 +851,9 @@ object_instance_props_to_g_parameters(JSContext *context,
JS::RootedObject props(context, &args[0].toObject());
JS::RootedId prop_id(context);
- JS::AutoIdArray ids(context, JS_Enumerate(context, props));
JS::RootedValue value(context);
- if (!ids) {
+ JS::Rooted<JS::IdVector> ids(context, context);
+ if (!JS_Enumerate(context, props, &ids)) {
gjs_throw(context, "Failed to create property iterator for object props hash");
goto free_array_and_fail;
}
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 5ee128e..c930eba 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -412,8 +412,8 @@ load_module_elements(JSContext *cx,
if (module_obj == NULL)
return;
- JS::AutoIdArray ids(cx, JS_Enumerate(cx, module_obj));
- if (!ids)
+ JS::Rooted<JS::IdVector> ids(cx, cx);
+ if (!JS_Enumerate(cx, module_obj, &ids))
return;
for (ix = 0, length = ids.length(); ix < length; ix++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]