[gjs/mozjs78: 34/50] Use JS::PropertyKey instead of removed macro. - 'INTERNED_STRING_TO_JSID' is now 'JS::PropertyKey::f
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/mozjs78: 34/50] Use JS::PropertyKey instead of removed macro. - 'INTERNED_STRING_TO_JSID' is now 'JS::PropertyKey::f
- Date: Tue, 4 Aug 2020 06:31:39 +0000 (UTC)
commit 81133acaf9729e16aef0ed022578847dd5a3ed0f
Author: Evan Welsh <noreply evanwelsh com>
Date: Sat Jul 4 22:14:39 2020 -0500
Use JS::PropertyKey instead of removed macro.
- 'INTERNED_STRING_TO_JSID' is now 'JS::PropertyKey::fromPinnedString'
gjs/atoms.cpp | 3 ++-
gjs/jsapi-util-string.cpp | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gjs/atoms.cpp b/gjs/atoms.cpp
index 5329ddc2..a349d0e7 100644
--- a/gjs/atoms.cpp
+++ b/gjs/atoms.cpp
@@ -39,7 +39,8 @@ bool GjsAtom::init(JSContext* cx, const char* str) {
JSString* s = JS_AtomizeAndPinString(cx, str);
if (!s)
return false;
- m_jsid = JS::Heap<jsid>{INTERNED_STRING_TO_JSID(cx, s)};
+
+ m_jsid = JS::Heap<jsid>{JS::PropertyKey::fromPinnedString(s)};
return true;
}
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index 49919411..a698cafb 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -37,7 +37,7 @@
#include <js/CharacterEncoding.h>
#include <js/Class.h>
#include <js/GCAPI.h> // for AutoCheckCannotGC
-#include <js/Id.h> // for JSID_IS_STRING, INTERNED_STRING_TO...
+#include <js/Id.h> // for JSID_IS_STRING...
#include <js/RootingAPI.h>
#include <js/Symbol.h>
#include <js/TypeDecls.h>
@@ -377,7 +377,7 @@ gjs_intern_string_to_id(JSContext *cx,
JS::RootedString str(cx, JS_AtomizeAndPinString(cx, string));
if (!str)
return JSID_VOID;
- return INTERNED_STRING_TO_JSID(cx, str);
+ return JS::PropertyKey::fromPinnedString(str);
}
[[nodiscard]] static std::string gjs_debug_flat_string(JSFlatString* fstr) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]