[gjs/mozjs102: 40/62] js: Use JS::PropertyKey::isVoid
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/mozjs102: 40/62] js: Use JS::PropertyKey::isVoid
- Date: Sun, 7 Aug 2022 17:52:59 +0000 (UTC)
commit 5de5a4f218f720dc46af8d3bc5ec88f0b99634b9
Author: Evan Welsh <contact evanwelsh com>
Date: Thu Jul 21 21:22:56 2022 -0700
js: Use JS::PropertyKey::isVoid
JSID_VOID is going away in mozjs102. The replacement is the isVoid()
method of JS::PropertyKey.
See: https://bugzilla.mozilla.org/show_bug.cgi?id=1754405
gi/boxed.cpp | 6 +++---
gi/cwrapper.h | 3 +--
gi/interface.cpp | 4 ++--
gi/ns.cpp | 2 +-
gi/object.cpp | 8 ++++----
gi/repo.cpp | 4 ++--
gjs/importer.cpp | 6 +++---
7 files changed, 16 insertions(+), 17 deletions(-)
---
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index ea146a912..c2063f84a 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -102,7 +102,7 @@ bool BoxedPrototype::new_enumerate_impl(JSContext* cx, JS::HandleObject,
if (flags & GI_FUNCTION_IS_METHOD) {
const char* name = meth_info.name();
jsid id = gjs_intern_string_to_id(cx, name);
- if (id == JSID_VOID)
+ if (id.isVoid())
return false;
if (!properties.append(id)) {
JS_ReportOutOfMemory(cx);
@@ -966,7 +966,7 @@ bool BoxedPrototype::init(JSContext* context) {
first_constructor = i;
first_constructor_name =
gjs_intern_string_to_id(context, func_info.name());
- if (first_constructor_name == JSID_VOID)
+ if (first_constructor_name.isVoid())
return false;
}
@@ -975,7 +975,7 @@ bool BoxedPrototype::init(JSContext* context) {
m_zero_args_constructor = i;
zero_args_constructor_name =
gjs_intern_string_to_id(context, func_info.name());
- if (zero_args_constructor_name == JSID_VOID)
+ if (zero_args_constructor_name.isVoid())
return false;
}
diff --git a/gi/cwrapper.h b/gi/cwrapper.h
index ebe1d1d7a..41095b48b 100644
--- a/gi/cwrapper.h
+++ b/gi/cwrapper.h
@@ -15,7 +15,6 @@
#include <js/CallArgs.h>
#include <js/Class.h>
-#include <js/ComparisonOperators.h>
#include <js/Id.h>
#include <js/Object.h> // for GetClass
#include <js/RootingAPI.h>
@@ -466,7 +465,7 @@ class CWrapper : public CWrapperPointerOps<Base, Wrapped> {
in_obj = gjs_get_import_global(cx);
JS::RootedId class_name(
cx, gjs_intern_string_to_id(cx, Base::klass.name));
- if (class_name == JSID_VOID ||
+ if (class_name.isVoid() ||
!JS_DefinePropertyById(cx, in_obj, class_name, ctor_obj,
GJS_MODULE_PROP_FLAGS))
return nullptr;
diff --git a/gi/interface.cpp b/gi/interface.cpp
index 9d0f14f70..c08294523 100644
--- a/gi/interface.cpp
+++ b/gi/interface.cpp
@@ -9,7 +9,7 @@
#include <js/Class.h>
#include <js/ErrorReport.h> // for JS_ReportOutOfMemory
-#include <js/Id.h> // for JSID_VOID, PropertyKey, jsid
+#include <js/Id.h> // for PropertyKey, jsid
#include <js/TypeDecls.h>
#include <js/Utility.h> // for UniqueChars
@@ -51,7 +51,7 @@ static bool append_inferface_properties(JSContext* cx,
if (flags & GI_FUNCTION_IS_METHOD) {
const char* name = meth_info.name();
jsid id = gjs_intern_string_to_id(cx, name);
- if (id == JSID_VOID)
+ if (id.isVoid())
return false;
properties.infallibleAppend(id);
}
diff --git a/gi/ns.cpp b/gi/ns.cpp
index a5d5feb3a..5d59b948e 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -145,7 +145,7 @@ class Ns : private GjsAutoChar, public CWrapper<Ns> {
const char* name = info.name();
jsid id = gjs_intern_string_to_id(cx, name);
- if (id == JSID_VOID)
+ if (id.isVoid())
return false;
properties.infallibleAppend(id);
}
diff --git a/gi/object.cpp b/gi/object.cpp
index 27935d1f7..fc2e25ebc 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -1124,7 +1124,7 @@ bool ObjectPrototype::new_enumerate_impl(JSContext* cx, JS::HandleObject,
if (flags & GI_FUNCTION_IS_METHOD) {
const char* name = meth_info.name();
jsid id = gjs_intern_string_to_id(cx, name);
- if (id == JSID_VOID)
+ if (id.isVoid())
return false;
properties.infallibleAppend(id);
}
@@ -1138,7 +1138,7 @@ bool ObjectPrototype::new_enumerate_impl(JSContext* cx, JS::HandleObject,
GjsAutoChar js_name = gjs_hyphen_to_underscore(prop_info.name());
jsid id = gjs_intern_string_to_id(cx, js_name);
- if (id == JSID_VOID)
+ if (id.isVoid())
return false;
properties.infallibleAppend(id);
}
@@ -1163,7 +1163,7 @@ bool ObjectPrototype::new_enumerate_impl(JSContext* cx, JS::HandleObject,
if (flags & GI_FUNCTION_IS_METHOD) {
const char* name = meth_info.name();
jsid id = gjs_intern_string_to_id(cx, name);
- if (id == JSID_VOID)
+ if (id.isVoid())
return false;
properties.infallibleAppend(id);
}
@@ -1176,7 +1176,7 @@ bool ObjectPrototype::new_enumerate_impl(JSContext* cx, JS::HandleObject,
GjsAutoChar js_name = gjs_hyphen_to_underscore(prop_info.name());
jsid id = gjs_intern_string_to_id(cx, js_name);
- if (id == JSID_VOID)
+ if (id.isVoid())
return false;
properties.infallibleAppend(id);
}
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 55c443e46..221cf8c79 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -18,7 +18,7 @@
#include <js/Class.h>
#include <js/ComparisonOperators.h>
#include <js/Exception.h>
-#include <js/Id.h> // for JSID_VOID
+#include <js/Id.h> // for PropertyKey
#include <js/Object.h> // for GetClass
#include <js/PropertyDescriptor.h> // for JSPROP_PERMANENT, JSPROP_RESOLVING
#include <js/RootingAPI.h>
@@ -482,7 +482,7 @@ gjs_lookup_namespace_object(JSContext *context,
}
JS::RootedId ns_name(context, gjs_intern_string_to_id(context, ns));
- if (ns_name == JSID_VOID)
+ if (ns_name.isVoid())
return nullptr;
return gjs_lookup_namespace_object_by_name(context, ns_name);
}
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 04a4a1087..78e21e2e3 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -284,7 +284,7 @@ gjs_import_native_module(JSContext *cx,
cx, gjs_get_native_registry(gjs_get_import_global(cx)));
JS::RootedId id(cx, gjs_intern_string_to_id(cx, parse_name));
- if (id == JSID_VOID)
+ if (id.isVoid())
return false;
JS::RootedObject module(cx);
@@ -693,7 +693,7 @@ static bool importer_new_enumerate(JSContext* context, JS::HandleObject object,
if (g_file_info_get_file_type(info) == G_FILE_TYPE_DIRECTORY) {
jsid id = gjs_intern_string_to_id(context, filename);
- if (id == JSID_VOID)
+ if (id.isVoid())
return false;
if (!properties.append(id)) {
JS_ReportOutOfMemory(context);
@@ -704,7 +704,7 @@ static bool importer_new_enumerate(JSContext* context, JS::HandleObject object,
GjsAutoChar filename_noext =
g_strndup(filename, strlen(filename) - 3);
jsid id = gjs_intern_string_to_id(context, filename_noext);
- if (id == JSID_VOID)
+ if (id.isVoid())
return false;
if (!properties.append(id)) {
JS_ReportOutOfMemory(context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]