[gjs/mozjs91: 7/17] JS_StringHasLatin1Chars is now JS::StringHasLatin1Chars




commit c4e6a50af6e2ffd81d21ac15570567b900de122e
Author: Evan Welsh <contact evanwelsh com>
Date:   Sat Jul 10 20:25:36 2021 -0700

    JS_StringHasLatin1Chars is now JS::StringHasLatin1Chars
    
    See https://bugzilla.mozilla.org/show_bug.cgi?id=1663365

 gjs/byteArray.cpp         | 6 ++++--
 gjs/gjs_pch.hh            | 1 +
 gjs/jsapi-util-string.cpp | 5 +++--
 3 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index 05c25034..453e059a 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -13,11 +13,13 @@
 
 #include <js/ArrayBuffer.h>
 #include <js/CallArgs.h>
+#include <js/CharacterEncoding.h>
 #include <js/GCAPI.h>  // for AutoCheckCannotGC
 #include <js/PropertySpec.h>
 #include <js/RootingAPI.h>
+#include <js/String.h>
 #include <js/TypeDecls.h>
-#include <js/Utility.h>   // for UniqueChars
+#include <js/Utility.h>  // for UniqueChars
 #include <js/experimental/TypedData.h>
 #include <jsapi.h>        // for JS_DefineFunctionById, JS_DefineFun...
 #include <jsfriendapi.h>  // for JS_NewUint8ArrayWithBuffer, GetUint...
@@ -164,7 +166,7 @@ from_string_func(JSContext *context,
             JS::AutoCheckCannotGC nogc;
             size_t len;
 
-            if (JS_StringHasLatin1Chars(str)) {
+            if (JS::StringHasLatin1Chars(str)) {
                 const JS::Latin1Char *chars =
                     JS_GetLatin1StringCharsAndLength(context, nogc, str, &len);
                 if (chars == NULL)
diff --git a/gjs/gjs_pch.hh b/gjs/gjs_pch.hh
index 0e79f1c6..60519829 100644
--- a/gjs/gjs_pch.hh
+++ b/gjs/gjs_pch.hh
@@ -85,6 +85,7 @@
 #include <js/RootingAPI.h>
 #include <js/SavedFrameAPI.h>
 #include <js/SourceText.h>
+#include <js/String.h>
 #include <js/Symbol.h>
 #include <js/TracingAPI.h>
 #include <js/TypeDecls.h>
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index 2dedbe40..3119d05a 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -24,6 +24,7 @@
 #include <js/Id.h>     // for JSID_IS_STRING...
 #include <js/Promise.h>
 #include <js/RootingAPI.h>
+#include <js/String.h>
 #include <js/Symbol.h>
 #include <js/TypeDecls.h>
 #include <js/Utility.h>  // for UniqueChars
@@ -209,7 +210,7 @@ gjs_string_get_char16_data(JSContext       *context,
                            char16_t       **data_p,
                            size_t          *len_p)
 {
-    if (JS_StringHasLatin1Chars(str))
+    if (JS::StringHasLatin1Chars(str))
         return from_latin1(context, str, data_p, len_p);
 
     /* From this point on, crash if a GC is triggered while we are using
@@ -255,7 +256,7 @@ gjs_string_to_ucs4(JSContext       *cx,
     size_t len;
     GError *error = NULL;
 
-    if (JS_StringHasLatin1Chars(str))
+    if (JS::StringHasLatin1Chars(str))
         return from_latin1(cx, str, ucs4_string_p, len_p);
 
     /* From this point on, crash if a GC is triggered while we are using


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