[gjs/wip/ptomato/mozjs45prep: 8/23] js: new JS_Enumerate api
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/ptomato/mozjs45prep: 8/23] js: new JS_Enumerate api
- Date: Tue, 21 Mar 2017 10:57:14 +0000 (UTC)
commit b25dfdb820a16a92fb2d72997388c5b76a96ae7c
Author: Philip Chimento <philip endlessm com>
Date: Sun Mar 19 04:53:15 2017 +0000
js: new JS_Enumerate api
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 5502b00..8a3631a 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -499,8 +499,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 e212b27..5a6fefe 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -268,9 +268,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 43cb425..c3bdf55 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -888,9 +888,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 c8e08bf..e2b9483 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -409,8 +409,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]