[gjs/wip/ptomato/mozjs52: 37/38] docs: Overview of SpiderMonkey 52 features in NEWS
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/ptomato/mozjs52: 37/38] docs: Overview of SpiderMonkey 52 features in NEWS
- Date: Wed, 28 Jun 2017 00:05:15 +0000 (UTC)
commit 7753e1d2dbddb8acce7dad860ee023093affb482
Author: Philip Chimento <philip chimento gmail com>
Date: Sun Jun 18 16:33:48 2017 -0700
docs: Overview of SpiderMonkey 52 features in NEWS
Distilled from Mozilla's documentation.
https://bugzilla.gnome.org/show_bug.cgi?id=784196
NEWS | 57 +++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 49 insertions(+), 8 deletions(-)
---
diff --git a/NEWS b/NEWS
index 306bd76..2d3f73e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,33 +1,57 @@
NEXT
----
-- New JavaScript features! This version of GJS is based on SpiderMonkey 45, an
+- New JavaScript features! This version of GJS is based on SpiderMonkey 52, an
upgrade from the previous ESR (Extended Support Release) of SpiderMonkey 38.
- Our plans are to continue upgrading to subsequent ESRs as maintainer
- availability allows. Here are the highlights of the new JavaScript features.
+ GJS now uses the latest ESR in its engine and the plan is to upgrade again
+ when SpiderMonkey 59 is released in March 2018, pending maintainer
+ availability. Here are the highlights of the new JavaScript features.
For more information, look them up on MDN or devdocs.io.
* New language features
+ ES6 classes
+ + Async functions and await operator
+ Reflect - built-in object with methods for interceptable operations
* New syntax
+ + Exponentiation operator: `**`
+ Variable-length Unicode code point escapes: `"\u{1f369}"`
+ Destructured default arguments: `function f([x, y]=[1, 2], {z: z}={z: 3})`
+ + Destructured rest parameters: `function f(...[a, b, c])`
+ `new.target` allows a constructor access to the original constructor that
was invoked
+ + Unicode (u) flag for regular expressions, and corresponding RegExp.unicode
+ property
+ + Trailing comma in function parameter lists now allowed
* New APIs
+ New Array, String, and TypedArray method: includes()
+ + TypedArray sort(), toLocaleString(), and toString() methods, to correspond
+ with regular arrays
+ + New Object.getOwnPropertyDescriptors() and Object.values() methods
+ + New Proxy traps: getPrototypeOf() and setPrototypeOf()
+ [Symbol.toPrimitive] property specifying how to convert an object to a
primitive value
+ [Symbol.species] property allowing to override the default constructor
for objects
- + [Symbol.match] property allowing to customize matching behaviour in RegExp
- subclasses
+ + [Symbol.match], [Symbol.replace], [Symbol.search], and [Symbol.split]
+ properties allowing to customize matching behaviour in RegExp subclasses
+ + [Symbol.hasInstance] property allowing to customize the behaviour of
+ the instanceof operator for objects
+ + [Symbol.toStringTag] property allowing to customize the message printed
+ by Object.toString() without overriding it
+ + [Symbol.isConcatSpreadable] property allowing to control the behaviour of
+ an array subclass in an argument list to Array.concat()
+ + [Symbol.unscopables] property allowing to control which object properties
+ are lifted into the scope of a with statement
+ + New Intl.getCanonicalLocales() method
+ Date.toString() and RegExp.toString() generic methods
+ + Typed arrays can now be constructed from any iterable object
+ + Array.toLocaleString() gained optional locales and options arguments, to
+ correspond with other toLocaleString() methods
* New behaviour
+ + The "arguments" object is now iterable
+ Date.prototype, WeakMap.prototype, and WeakSet.prototype are now ordinary
objects, not instances
+ Full ES6-compliant implementation of let keyword
@@ -39,17 +63,34 @@ NEXT
followed by `new f` will not work)
+ It is now required to construct ArrayBuffer, TypedArray, Map, Set, and
WeakMap with the new operator
+ + Block-level functions (e.g. `{ function foo() {} }`) are now allowed in
+ strict mode; they are scoped to their block
+ + The options.timeZone argument to Date.toLocaleDateString(),
+ Date.toLocaleString(), Date.toLocaleTimeString(), and the constructor of
+ Intl.DateTimeFormat now understands IANA time zone names (such as
+ "America/Vancouver")
* Backwards-incompatible changes
+ Non-standard "let expressions" and "let blocks" (e.g.,
`let (x = 5) { use(x) }`) are not supported any longer
+ + Non-standard flags argument to String.match(), String.replace(), and
+ String.search() (e.g. `str.replace('foo', 'bar', 'g')`) is now ignored
+ + Non-standard WeakSet.clear() method has been removed
+ Variables declared with let and const are now 'global lexical bindings',
as per the ES6 standard, meaning that they will not be exported in
- modules. If you cannot find symbols in your imported modules after the
- upgrade, then likely you need to change "let" or "const" to "var" inside
- your module file. For more information, read
+ modules. We are maintaining the old behaviour for the time being as a
+ compatibility workaround, but please change "let" or "const" to "var"
+ inside your module file. A warning will remind you of this. For more
+ information, read:
https://blog.mozilla.org/addons/2015/10/14/breaking-changes-let-const-firefox-nightly-44/
+ * Experimental features (may change in future versions)
+ + String.padEnd(), String.padStart() methods (proposed in ES2017)
+ + Intl.DateTimeFormat.formatToParts() method (proposed in ES2017)
+ + Object.entries() method (proposed in ES2017)
+ + Atomics, SharedArrayBuffer, and WebAssembly are disabled by default, but
+ can be enabled if you compile mozjs yourself.
+
Version 1.49.3
--------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]