diff --git a/website/buildsite.py b/website/buildsite.py index ae58083b..5a9b5dc0 100644 --- a/website/buildsite.py +++ b/website/buildsite.py @@ -939,8 +939,7 @@ def generateGuide(): navlinks.append(['#ctypes', 'C types']) navlinks.append(['#typealgorithms', 'Type algorithms']) navlinks.append(['#duktapebuiltins', 'Duktape built-ins']) - navlinks.append(['#es6features', 'ES2015 (E6) features']) - navlinks.append(['#es7features', 'ES2016 (E7) features']) + navlinks.append(['#postes5features', 'Post-ES5 features']) navlinks.append(['#custombehavior', 'Custom behavior']) navlinks.append(['#customjson', 'Custom JSON formats']) navlinks.append(['#customdirectives', 'Custom directives']) @@ -990,8 +989,7 @@ def generateGuide(): res += processRawDoc('guide/ctypes.html') res += processRawDoc('guide/typealgorithms.html') res += processRawDoc('guide/duktapebuiltins.html') - res += processRawDoc('guide/es6features.html') - res += processRawDoc('guide/es7features.html') + res += processRawDoc('guide/postes5features.html') res += processRawDoc('guide/custombehavior.html') res += processRawDoc('guide/customjson.html') res += processRawDoc('guide/customdirectives.html') diff --git a/website/guide/es6features.html b/website/guide/es6features.html deleted file mode 100644 index d7234626..00000000 --- a/website/guide/es6features.html +++ /dev/null @@ -1,126 +0,0 @@ -

Ecmascript 2015 (E6) features

- -

This section describes the current set of features Duktape implements from -Ecmascript 2015 (E6). -Many of the features can be disabled through config options such as -DUK_USE_ES6_PROXY and DUK_USE_BUFFEROBJECT_SUPPORT.

- -

ES6 Annex B RegExp syntax

- -

Duktape supports some of the additional RegExp syntax defined in -ES6 Annex B.1.4.

- -

Const variables

- -

Duktape has minimal support for -const -declarations to allow existing code using const to run. However, -const is mostly just an alias for var and currently has -the following non-standard semantics:

- - -

Computed property names

- -

Computed property names are supported and allow syntax like -{ [1 + 2]: "three" }.

- -

Octal and binary number literals

- -

The 0o755 and 0b10001010 literal formats -are supported. Legacy octal literals like 0755 are also -supported.

- -

\u{H+} escape syntax

- -

The \u{H+} escape syntax is supported in source code string -literals and identifier names. Codepoints above non-BMP, for example -\u{1f4a9}, are decoded into surrogate pairs during parsing. -RegExps don't yet support this escape format as it requires currently -unsupported RegExp Unicode mode (/u).

- -

Object.setPrototypeOf and Object.prototype.__proto__

- -

Object.setPrototypeOf -allows user to set the internal prototype of an object which is not supported in -Ecmascript E5. Ecmascript E6 also provides -Object.prototype.__proto__, -an accessor property (setter/getter) which provides the same functionality -but is compatible with existing code base which has relied on a non-standard -__proto__ property for a while. Duktape does not support the -__proto__ property name in an object initializer.

- -

Reflect built-in

- -

The Reflect built-in provides access to several fundamental -Ecmascript primitives as function calls. For example, Reflect.has() -works like the in operator, and Reflect.construct() -is like new. It also serves as a namespace for several functions -previously exposed through Object, such as -Reflect.defineProperty().

- -

Proxy object (subset)

- -

The Ecmascript E6 Proxy object allows property virtualization -and fine-grained access control for accessing an underlying plain object. -Duktape implements a strict subset of the Proxy object from -ES6. The following traps are implemented:

- - - - - - - - - - - - - - - - - - - - - -
TrapImplementedNotes
getPrototypeOfno
setPrototypeOfno
isExtensibleno
preventExtensionno
getOwnPropertyDescriptorno
definePropertyno
hasyesObject.hasOwnProperty() does not invoke the trap at the moment, key in obj does.
getyes
setyes
deletePropertyyes
enumerateno (*)The "enumerate" trap was removed in ES7 and for-in uses "ownKeys" trap; Duktape 1.x supports "enumerate" trap in for-in.
ownKeysyesSome trap result validation (non-configurable properties, non-extensible target) not yet implemented.
applyno
constructno
- -

Limitations include:

- - -

Typed arrays

- -

Duktape implements Khronos typed array support which is a subset of ES6 -typed arrays.

- -

Enumeration order

- -

Object.getOwnPropertyNames() follows the -ES6 [[OwnPropertyKeys]] -enumeration order: (1) array indices in ascending order, (2) other properties -in insertion order, (3) symbols in insertion order. While ES6 or ES7 doesn't -require it, Duktape follows this same order also for for-in, -Object.keys(), and duk_enum() in general. As in V8, -the rule is applied for every "inheritance level" in turn, i.e. inherited -non-duplicate properties always follow child properties.

diff --git a/website/guide/es7features.html b/website/guide/es7features.html deleted file mode 100644 index 87f548f9..00000000 --- a/website/guide/es7features.html +++ /dev/null @@ -1,10 +0,0 @@ -

Ecmascript 2016 (E7) features

- -

This section describes the current set of features Duktape implements from -Ecmascript 2016 (E7). -Some features can be disabled through config options such as -DUK_USE_ES7_EXP_OPERATOR.

- -

ES7 exponentiation operator (** and **=)

- -

The ** and **= operators are supported.

diff --git a/website/guide/intro.html b/website/guide/intro.html index 18351ef8..b5588ed3 100644 --- a/website/guide/intro.html +++ b/website/guide/intro.html @@ -162,8 +162,7 @@ wrappers are discussed in detail.

Duktape specific Ecmascript features are discussed in multiple sections: Type algorithms (for custom types), Duktape built-ins (additional built-ins), -Ecmascript 2015 (E6) features (features implemented from ES6), -Ecmascript 2016 (E7) features (features implemented from ES7), +Post-ES5 features (features implemented from ES2016 and beyond), Custom behavior (behavior differing from standard), Custom JSON formats, Custom directives, diff --git a/website/guide/postes5features.html b/website/guide/postes5features.html new file mode 100644 index 00000000..efb8b9e9 --- /dev/null +++ b/website/guide/postes5features.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + +

Post-ES5 features

+ +

Duktape implements features from ES2015 (ES6), ES2016 (ES7), and later +specification drafts. See Wiki article +Post-ES5 features +for current status.