[gjs/mozjs78: 11/23] Use JS::PropertyKey instead of removed macro. - 'INTERNED_STRING_TO_JSID' is now 'JS::PropertyKey::f



commit 592b176f127bf6192a95de944c67d3f24be62d51
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 5c6d9e56..43a71284 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);
 }
 
 GJS_USE


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]