[gjs/mozjs91: 20/21] doc: Update for SpiderMonkey 91




commit f7ea407596445dcbe4885b421986d735621421ff
Author: Evan Welsh <contact evanwelsh com>
Date:   Fri Aug 6 19:21:32 2021 -0700

    doc: Update for SpiderMonkey 91

 README.MSVC.md              | 26 ++++++++++++--------------
 doc/Hacking.md              | 19 ++++++++++---------
 doc/Home.md                 |  4 ++--
 doc/SpiderMonkey_Memory.md  |  4 +---
 gi/gerror.cpp               |  5 ++---
 gjs/jsapi-dynamic-class.cpp |  5 ++---
 gjs/module.h                |  3 +--
 meson.build                 |  2 +-
 8 files changed, 31 insertions(+), 37 deletions(-)
---
diff --git a/README.MSVC.md b/README.MSVC.md
index 3ea9a474..79fa9a8f 100644
--- a/README.MSVC.md
+++ b/README.MSVC.md
@@ -7,13 +7,13 @@ recent-enough Windows SDK from Microsoft is still required if using
 clang-cl, as we will still use items from the Windows SDK.
 
 Recent official binary installers of CLang (which contains clang-cl)
-from the LLVM website are known to work to build SpiderMonkey 78 and
+from the LLVM website are known to work to build SpiderMonkey 91 and
 GJS.
 
 You will need the following items to build GJS using Visual Studio
 or clang-cl (they can be built with Visual Studio 2015 or later,
 unless otherwise noted):
--SpiderMonkey 78.x (mozjs-78). This must be built with clang-cl as
+-SpiderMonkey 91.x (mozjs-91). This must be built with clang-cl as
  the Visual Studio  compiler is no longer supported for building this.
  Please see the below section carefully on this...
 -GObject-Introspection (G-I) 1.61.2 or later
@@ -44,8 +44,8 @@ for the suitable release series of SpiderMonkey that corresponds to
 the GJS version that is being built, as GJS depends on ESR (Extended 
 Service Release, a.k.a Long-term support) releases of SpiderMonkey.
 
-You may also be able to obtain the SpiderMonkey 78.x sources via the
-FireFox (ESR) or Thunderbird 78.x sources, in $(srcroot)/js.
+You may also be able to obtain the SpiderMonkey 91.x sources via the
+FireFox (ESR) or Thunderbird 91.x sources, in $(srcroot)/js.
 
 Please do note that the build must be done carefully, in addition to the
 official instructions that are posted on the Mozilla website:
@@ -62,7 +62,7 @@ JS_STANDALONE=1 $(mozjs_srcroot)/js/src/configure --enable-nspr-build --host=i68
 
 Notice that "JS_STANDALONE=1" and "--disable-jemalloc" are absolutely required,
 otherwise GJS will not build/run correctly.  If your GJS build crashes upon
-launch, use Dependency Walker to ensure that mozjs-78.dll does not depend on
+launch, use Dependency Walker to ensure that mozjs-91.dll does not depend on
 mozglue.dll!  If it does, or if GJS fails to link with missing arena_malloc() and
 friends symbols, you have built SpiderMoney incorrectly and will need to rebuild
 SpiderMonkey (with the build options as noted above) and retry the build.
@@ -91,7 +91,7 @@ $(buildroot)/dist/include.  Note that for PDB files and .lib files,
 you will need to search for them in $(buildroot),
 where the PDB file names match the filenames for the DLLs/EXEs in
 $(buildroot)/dist/bin, and you will need to look for the following .lib files:
--mozjs-78.lib
+-mozjs-91.lib
 -js_static.lib (optional)
 -nspr4.lib (optional, recommended for future use, if --enable-nspr-build is used)
 -plc4.lib (optional, recommended for future use, if --enable-nspr-build is used)
@@ -99,16 +99,14 @@ $(buildroot)/dist/bin, and you will need to look for the following .lib files:
 
 You may want to put the .lib's and DLLs/EXEs into $(PREFIX)\lib and 
 $(PREFIX)\bin respectively, and put the headers into
-$(PREFIX)\include\mozjs-78 for convenience.
+$(PREFIX)\include\mozjs-91 for convenience.
 
-You will need to place the generated mozjs-78.pc pkg-config file into
+You will need to place the generated mozjs-91.pc pkg-config file into
 $(PREFIX)\lib\pkgconfig and ensure that pkg-config can find it by
 setting PKG_CONFIG_PATH.  Ensure that the 'includedir' and 'libdir'
 in there is correct, and remove the 'nspr' entry from the
-'Requires.private:' line and change
-'-include ${includedir}/mozjs-78/js/RequiredDefines.h' to
-'-FI${includedir}/mozjs-78/js/RequiredDefines.h', so that the
-mozjs-78.pc can be used correctly in Visual Studio/clang-cl builds.  You
+'Requires.private:' line so that the
+mozjs-91.pc can be used correctly in Visual Studio/clang-cl builds.  You
 will also need to ensure that the existing GObject-Introspection
 installation (if used) is on the same drive where the GJS sources
 are (and therefore where the GJS build is being carried out).
@@ -117,13 +115,13 @@ Since Mozilla insisted that clang-cl is to be used to build SpiderMonkey,
 note that some SpideMonkey headers might need be updated as follows, if intending
 to build without clang-cl, since there are some GCC-ish assumptions here:
 
--Update $(includedir)/mozjs-78/js/AllocPolicy.h (after the build):
+-Update $(includedir)/mozjs-91/js/AllocPolicy.h (after the build):
 
 Get rid of the 'JS_FRIEND_API' macro from the class
 'TempAllocPolicy : public AllocPolicyBase' (ca. lines 112 and 178),
 for the member method definitions of onOutOfMemory() and reportAllocOverflow()
 
--Update $(includedir)/mozjs-78/js/BigInt.h (after the build):
+-Update $(includedir)/mozjs-91/js/BigInt.h (after the build):
 
 Remove the 'JS_PUBLIC_API' macro from the definition of
 'template <typename NumericT>
diff --git a/doc/Hacking.md b/doc/Hacking.md
index ba562e0d..1c732f43 100644
--- a/doc/Hacking.md
+++ b/doc/Hacking.md
@@ -37,7 +37,7 @@ You can also skip this step if you are not writing any C++ code.)
 ## Dependencies
 
 GJS requires five other libraries to be installed: GLib, libffi,
-gobject-introspection, SpiderMonkey (also called "mozjs78" on some
+gobject-introspection, SpiderMonkey (also called "mozjs91" on some
 systems.) and the build tool Meson.
 The readline library is not required, but strongly recommended.
 We recommend installing your system's development packages for GLib,
@@ -66,18 +66,19 @@ will help catch mistakes in the API that could otherwise go unnoticed
 and cause crashes in gnome-shell later on.
 
 If you aren't writing any C++ code, and your system provides it (for
-example, Fedora 33 or Ubuntu 20.10 and later versions), then you don't
+example, Fedora 36 or Ubuntu 22.04 and later versions), then you don't
 need to build it yourself.
 Install SpiderMonkey using your system's package manager instead:
 
-<details>
+<!--Ubuntu does not currently ship a build of libmozjs-91-->
+<!-- <details>
     <summary>Ubuntu</summary>
-    <code>sudo apt-get install libmozjs-78-dev</code>
-</details>
+    <code>sudo apt-get install libmozjs-91-dev</code>
+</details> -->
 
 <details>
     <summary>Fedora</summary>
-    <code>sudo dnf install mozjs78-devel</code>
+    <code>sudo dnf install mozjs91-devel</code>
 </details>
 
 If you _are_ writing C++ code, then please build SpiderMonkey yourself
@@ -85,7 +86,7 @@ with the debugging features enabled.
 This can save you time later when you submit your merge request, because
 the code will be checked using the debugging features.
 
-To build SpiderMonkey, follow the instructions on [this 
page](https://github.com/mozilla-spidermonkey/spidermonkey-embedding-examples/blob/esr78/docs/Building%20SpiderMonkey.md)
 to download the source code and build the library.
+To build SpiderMonkey, follow the instructions on [this 
page](https://github.com/mozilla-spidermonkey/spidermonkey-embedding-examples/blob/esr91/docs/Building%20SpiderMonkey.md)
 to download the source code and build the library.
 If you are using `-Dprefix` to build GJS into a different path, then
 make sure to use the same build prefix for SpiderMonkey with `--prefix`.
 
@@ -151,7 +152,7 @@ more likely to show up.
 
 To see which GC zeal options are available:
 ```sh
-JS_GC_ZEAL=-1 js78
+JS_GC_ZEAL=-1 js91
 ```
 
 We include three test setups, `extra_gc`, `pre_verify`, and
@@ -215,7 +216,7 @@ This will build GJS into a separate build directory with code coverage
 instrumentation enabled, run the test suite to collect the coverage
 data, and open the generated HTML report.
 
-[embedder](https://github.com/spidermonkey-embedders/spidermonkey-embedding-examples/blob/esr78/docs/Building%20SpiderMonkey.md)
+[embedder](https://github.com/spidermonkey-embedders/spidermonkey-embedding-examples/blob/esr91/docs/Building%20SpiderMonkey.md)
 
 ## Troubleshooting
 
diff --git a/doc/Home.md b/doc/Home.md
index 899507df..d0a09dc1 100644
--- a/doc/Home.md
+++ b/doc/Home.md
@@ -1,7 +1,7 @@
 # GJS: Javascript Bindings for GNOME
 
-The current stable series is built on Mozilla's SpiderMonkey 78,
-featuring **ECMAScript 2019** and GObject Introspection making most of
+The current stable series is built on Mozilla's SpiderMonkey 91,
+featuring **ECMAScript 2022** and GObject Introspection making most of
 the **GNOME platform API** available.
 
 To find out when a language feature was implemented in GJS, review [NEWS][gjs-news] in the GitLab 
repository. In many cases older versions of GJS can be supported using [polyfills][mdn-polyfills] and 
[legacy-style GJS classes](Modules.md#lang).
diff --git a/doc/SpiderMonkey_Memory.md b/doc/SpiderMonkey_Memory.md
index ae8d2f73..99f893f7 100644
--- a/doc/SpiderMonkey_Memory.md
+++ b/doc/SpiderMonkey_Memory.md
@@ -84,9 +84,7 @@ Any SpiderMonkey APIs that can cause a garbage collection will force you to use
 So instead of the above code, you would write
 
 ```c++
-JS::RootedObject obj(cx);
-if (!JS::Construct(cx, whatever, ..., &obj))
-  ...
+JS::RootedObject obj(cx, JS_NewPlainObject(cx));
 ```
 
 ### JSFunctionSpec and extra local roots ###
diff --git a/gi/gerror.cpp b/gi/gerror.cpp
index 529c38d6..10b26b3b 100644
--- a/gi/gerror.cpp
+++ b/gi/gerror.cpp
@@ -336,11 +336,10 @@ gjs_error_from_js_gerror(JSContext *cx,
     JS::RootedObject error_constructor(cx);
     if (!JS_GetClassObject(cx, error_kind, &error_constructor))
         return nullptr;
-    JS::RootedValue error_constructorv(cx);
-    error_constructorv.setObject(*error_constructor);
+    JS::RootedValue v_error_constructor(cx, JS::ObjectValue(*error_constructor));
 
     JS::RootedObject object(cx);
-    if (!JS::Construct(cx, error_constructorv, error_args, &object))
+    if (!JS::Construct(cx, v_error_constructor, error_args, &object))
         return nullptr;
 
     return object;
diff --git a/gjs/jsapi-dynamic-class.cpp b/gjs/jsapi-dynamic-class.cpp
index 18440b58..7b89e75b 100644
--- a/gjs/jsapi-dynamic-class.cpp
+++ b/gjs/jsapi-dynamic-class.cpp
@@ -141,12 +141,11 @@ gjs_construct_object_dynamic(JSContext                  *context,
                                      atoms.constructor(), &constructor))
         return NULL;
 
-    JS::RootedValue constructorv(context);
-    constructorv.setObject(*constructor);
+    JS::RootedValue v_constructor(context, JS::ObjectValue(*constructor));
 
     JS::RootedObject object(context);
 
-    if (!JS::Construct(context, constructorv, args, &object))
+    if (!JS::Construct(context, v_constructor, args, &object))
         return nullptr;
 
     return object;
diff --git a/gjs/module.h b/gjs/module.h
index 276d8a93..19b25d44 100644
--- a/gjs/module.h
+++ b/gjs/module.h
@@ -36,8 +36,7 @@ JSObject* gjs_module_load(JSContext* cx, const char* identifier,
                           const char* uri);
 
 GJS_JSAPI_RETURN_CONVENTION
-JSObject* gjs_module_resolve(JSContext* cx,
-                             JS::HandleValue importing_module_priv,
+JSObject* gjs_module_resolve(JSContext* cx, JS::HandleValue importing_module_priv,
                              JS::HandleObject module_request);
 
 GJS_JSAPI_RETURN_CONVENTION
diff --git a/meson.build b/meson.build
index f5933926..0d81bc25 100644
--- a/meson.build
+++ b/meson.build
@@ -252,7 +252,7 @@ if not minimal_program.compiled() or minimal_program.returncode() != 0
     error('''A minimal SpiderMonkey program
 could not be compiled, linked, or run. Most likely you should build it with a
 different configuration. Check the recommended configuration:
-https://github.com/spidermonkey-embedders/spidermonkey-embedding-examples/blob/esr78/docs/Building%20SpiderMonkey.md''')
+https://github.com/spidermonkey-embedders/spidermonkey-embedding-examples/blob/esr91/docs/Building%20SpiderMonkey.md''')
 endif
 
 have_printf_alternative_int = cc.compiles('''


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