[gjs: 21/25] docs: Update documentation for SpiderMonkey 68



commit a3c8f4caa973f967d6f74c2ab5e94ab840d015a2
Author: Philip Chimento <philip chimento gmail com>
Date:   Fri May 17 23:22:19 2019 -0700

    docs: Update documentation for SpiderMonkey 68
    
    This updates build and hacking instructions where applicable, and
    describes the new language features in the NEWS file.

 NEWS           | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 README.MSVC.md | 18 +++++++++---------
 doc/Hacking.md |  6 +++---
 3 files changed, 71 insertions(+), 12 deletions(-)
---
diff --git a/NEWS b/NEWS
index 7a582977..f434b7ff 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,62 @@
+NEXT
+----
+
+- New JavaScript features! This version of GJS is based on SpiderMonkey 68, an
+  upgrade from the previous ESR (Extended Support Release) of SpiderMonkey 60.
+  Here are the highlights of the new JavaScript features.
+  For more information, look them up on MDN or devdocs.io.
+
+  * New language features
+    + The BigInt type, currently a stage 3 proposal in the ES standard, is now
+      available.
+
+  * New syntax
+    + `globalThis` is now the ES-standard supported way to get the global
+      object, no matter what kind of JS environment. The old way, `window`, will
+      still work, but is no longer preferred.
+    + BigInt literals are expressed by a number with "n" appended to it: for
+      example, `1n`, `9007199254740992n`.
+
+  * New APIs
+    + String.prototype.trimStart() and String.prototype.trimEnd() now exist and
+      are preferred instead of trimLeft() and trimRight() which are nonstandard.
+    + String.prototype.matchAll() allows easier access to regex capture groups.
+    + Array.prototype.flat() flattens nested arrays, well-known from lodash and
+      similar libraries.
+    + Array.prototype.flatMap() acts like a reverse filter(), allowing adding
+      elements to an array while iterating functional-style.
+    + Object.fromEntries() creates an object from iterable key-value pairs.
+    + Intl.RelativeTimeFormat is useful for formatting time differences into
+      human-readable strings such as "1 day ago".
+    + BigInt64Array and BigUint64Array are two new typed array types.
+
+  * New behaviour
+    + There are a lot of minor behaviour changes as SpiderMonkey's JS
+      implementation conforms ever closer to existing ECMAScript standards and
+      adopts new ones. For complete information, read the Firefox developer
+      release notes:
+      https://developer.mozilla.org/en-US/Firefox/Releases/61#JavaScript
+      https://developer.mozilla.org/en-US/Firefox/Releases/62#JavaScript
+      https://developer.mozilla.org/en-US/Firefox/Releases/63#JavaScript
+      https://developer.mozilla.org/en-US/Firefox/Releases/64#JavaScript
+      https://developer.mozilla.org/en-US/Firefox/Releases/65#JavaScript
+      https://developer.mozilla.org/en-US/Firefox/Releases/66#JavaScript
+      https://developer.mozilla.org/en-US/Firefox/Releases/67#JavaScript
+      https://developer.mozilla.org/en-US/Firefox/Releases/68#JavaScript
+
+  * Backwards-incompatible changes
+    + The nonstandard String generics were removed. These had only ever been
+      implemented by Mozilla and never made it into a standard. (An example of a
+      String generic is calling a string method on something that might not be a
+      string like this: `String.endsWith(foo, 5)`. The proper way is
+      `String.prototype.endsWith.call(foo, 5)` or converting `foo` to a string.)
+      This should not pose much of a problem for existing code, since in the
+      previous version these would already print a deprecation warning whenever
+      they were used.
+      You can use `moz68tool` from mozjs-deprecation-tools
+      (https://gitlab.gnome.org/ptomato/moz60tool) to scan your code for this
+      nonstandard usage.
+
 Version 1.63.3
 --------------
 
diff --git a/README.MSVC.md b/README.MSVC.md
index a6749cbf..7ee37cab 100644
--- a/README.MSVC.md
+++ b/README.MSVC.md
@@ -6,7 +6,7 @@ via Meson.  Due to C++-14 usage, Visual Studio 2017 15.6.x or later is
 required, as the compiler flag /Zc:externConstexpr is needed.
 
 You will need the following items to build GJS using Visual Studio:
--SpiderMonkey 60 (mozjs-60).  Please see the below section carefully 
+-SpiderMonkey 68 (mozjs-68).  Please see the below section carefully 
  on this...
 -GObject-Introspection (G-I) 1.61.2 or later
 -GLib 2.58.x or later, (which includes GIO, GObject, and the associated tools)
@@ -43,7 +43,7 @@ JS_STANDALONE=1 $(mozjs_srcroot)/js/src/configure --enable-nspr-build --prefix=<
 
 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 Depedency Walker to ensure that mozjs-60.dll does not depend on
+launch, use Depedency Walker to ensure that mozjs-68.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.
@@ -72,7 +72,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-60.lib
+-mozjs-68.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)
@@ -80,16 +80,16 @@ $(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-60 for convenience.
+$(PREFIX)\include\mozjs-68 for convenience.
 
-You will need to place the generated mozjs-60.pc pkg-config file into
+You will need to place the generated mozjs-68.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-60/js/RequiredDefines.h' to
-'-FI${includedir}/mozjs-60/js/RequiredDefines.h', so that the
-mozjs-60.pc can be used correctly in Visual Studio builds.  You
+'-include ${includedir}/mozjs-68/js/RequiredDefines.h' to
+'-FI${includedir}/mozjs-68/js/RequiredDefines.h', so that the
+mozjs-68.pc can be used correctly in Visual Studio 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,4 +117,4 @@ ninja
 Visual Studio 2017 or 2019 if --backend=vs[2017|2019] is used)
 
 You may choose to install the build results using 'ninja install'
-or running the 'install' project when the build succeeds.
\ No newline at end of file
+or running the 'install' project when the build succeeds.
diff --git a/doc/Hacking.md b/doc/Hacking.md
index 41fe27a8..d6eb0b1c 100644
--- a/doc/Hacking.md
+++ b/doc/Hacking.md
@@ -13,7 +13,7 @@ you'll need to manually format your code before it gets merged.
 You can also skip this step if you are not writing any C++ code.)
 
 GJS requires four other libraries to be installed: GLib, libffi,
-gobject-introspection, and SpiderMonkey (also called "mozjs60" on some
+gobject-introspection, and SpiderMonkey (also called "mozjs68" on some
 systems.)
 The readline library is not required, but strongly recommended.
 We recommend installing your system's development packages for GLib,
@@ -93,7 +93,7 @@ more likely to show up.
 
 To see which GC zeal options are available:
 ```sh
-JS_GC_ZEAL=-1 js60
+JS_GC_ZEAL=-1 js68
 ```
 
 We include three test setups, `extra_gc`, `pre_verify`, and
@@ -157,4 +157,4 @@ 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/esr60/docs/Building%20SpiderMonkey.md)
\ No newline at end of file
+[embedder](https://github.com/spidermonkey-embedders/spidermonkey-embedding-examples/blob/esr68/docs/Building%20SpiderMonkey.md)
\ No newline at end of file


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