From 178cecb0bcdb418aee430d035c2297ae07c41ede Mon Sep 17 00:00:00 2001 From: Sami Vaarala Date: Sat, 8 Oct 2016 03:55:59 +0300 Subject: [PATCH 1/3] Website updates for ES6 and ES7 * Use Ecmascript 2015 (E6) and Ecmascript 2016 (E7) to reference the specifications. * Add ES7 exponentiation operator. --- website/buildsite.py | 4 +++- website/guide/compatibility.html | 9 +++++++-- website/guide/compiling.html | 3 ++- website/guide/duktapebuiltins.html | 2 -- website/guide/es6features.html | 24 +++++++----------------- website/guide/es7features.html | 10 ++++++++++ website/guide/intro.html | 20 ++++++++++---------- website/index/index.html | 5 +++-- 8 files changed, 42 insertions(+), 35 deletions(-) create mode 100644 website/guide/es7features.html diff --git a/website/buildsite.py b/website/buildsite.py index 079d78fa..f599b85c 100644 --- a/website/buildsite.py +++ b/website/buildsite.py @@ -939,7 +939,8 @@ def generateGuide(): navlinks.append(['#ctypes', 'C types']) navlinks.append(['#typealgorithms', 'Type algorithms']) navlinks.append(['#duktapebuiltins', 'Duktape built-ins']) - navlinks.append(['#es6features', 'Ecmascript E6 features']) + navlinks.append(['#es6features', 'ES2015 (E6) features']) + navlinks.append(['#es7features', 'ES2016 (E7) features']) navlinks.append(['#custombehavior', 'Custom behavior']) navlinks.append(['#customjson', 'Custom JSON formats']) navlinks.append(['#customdirectives', 'Custom directives']) @@ -990,6 +991,7 @@ def generateGuide(): res += processRawDoc('guide/typealgorithms.html') res += processRawDoc('guide/duktapebuiltins.html') res += processRawDoc('guide/es6features.html') + res += processRawDoc('guide/es7features.html') res += processRawDoc('guide/custombehavior.html') res += processRawDoc('guide/customjson.html') res += processRawDoc('guide/customdirectives.html') diff --git a/website/guide/compatibility.html b/website/guide/compatibility.html index 74fba29d..53dfe0e6 100644 --- a/website/guide/compatibility.html +++ b/website/guide/compatibility.html @@ -8,11 +8,16 @@ extensions, frameworks, and test suites.

The main compatibility goal of Duktape is to be Ecmascript E5/E5.1 compatible. Current level of compatibility should be quite high.

-

Ecmascript E6

+

Ecmascript 2015 (E6)

-

Duktape borrows a few features from Ecmascript E6, but generally there +

Duktape implements some features from Ecmascript 2015 (E6), but generally there is no compatibility with E6 yet.

+

Ecmascript 2016 (E7)

+ +

Duktape implements some features from Ecmascript 2016 (E7), but generally there +is no compatibility with E7 yet.

+

Ecmascript E3

There is no effort to maintain diff --git a/website/guide/compiling.html b/website/guide/compiling.html index 135cf579..5973c44c 100644 --- a/website/guide/compiling.html +++ b/website/guide/compiling.html @@ -65,7 +65,8 @@ architecture detection and use the Duktape default configuration:

features), except for intentional real world compatibility deviations (see Custom behavior)
  • Khronos/ES6 typed array and Node.js Buffer support
  • -
  • Some features borrowed from ES6
  • +
  • Some features from Ecmascript 2015 (E6) and + Ecmascript 2016 (E7)
  • Packed value representation (8 bytes per value) when available, unpacked value representation (usually 16 bytes per value) when not
  • Reference counting and mark-and-sweep garbage collection
  • diff --git a/website/guide/duktapebuiltins.html b/website/guide/duktapebuiltins.html index 7f2b03f2..8ea4c916 100644 --- a/website/guide/duktapebuiltins.html +++ b/website/guide/duktapebuiltins.html @@ -14,8 +14,6 @@ values.

    Duktape The Duktape built-in object. Contains miscellaneous implementation specific stuff. -Proxy - Proxy constructor borrowed from ES6 (not part of Ecmascript E5/E5.1). diff --git a/website/guide/es6features.html b/website/guide/es6features.html index 075bd2c6..c9e21a2b 100644 --- a/website/guide/es6features.html +++ b/website/guide/es6features.html @@ -1,16 +1,14 @@ -

    Ecmascript E6 features

    +

    Ecmascript 2015 (E6) features

    -

    This section describes the small set of features Duktape borrows from -Ecmascript E6. -These features are not fully compliant; the intent is to minimize custom features -and to align with the ES6 specification when possible.

    +

    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. -These features can be enabled/disabled using the DUK_USE_ES6_REGEXP_SYNTAX -config option (enabled by default).

    +ES6 Annex B.1.4.

    Const variables

    @@ -45,10 +43,6 @@ 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.

    -

    These custom features can be disabled by disabling the config options -DUK_USE_ES6_OBJECT_SETPROTOTYPEOF and -DUK_USE_ES6_OBJECT_PROTO_PROPERTY.

    -

    Proxy object (subset)

    The Ecmascript E6 Proxy object allows property virtualization @@ -97,11 +91,7 @@ ES6. The following traps are implemented:

    enforces it to simplify the internal implementation. -

    This custom feature can be disabled by disabling the config option -DUK_USE_ES6_PROXY.

    -

    Typed arrays

    Duktape implements Khronos typed array support which is a subset of ES6 -typed arrays. Support for typed arrays and Node.js Buffer can be disabled -by disabling the config option DUK_USE_BUFFEROBJECT_SUPPORT.

    +typed arrays.

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

    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 9afaddc3..16d9d906 100644 --- a/website/guide/intro.html +++ b/website/guide/intro.html @@ -40,18 +40,16 @@ Ecmascript throughout to refer to the language implemented by Duktape.

    Conformance

    -

    Duktape conforms to the following Ecmascript specifications:

    +

    Duktape conforms to ES5.0/ES5.1:

    -

    Duktape borrows -a few features from Ecmascript E6:

    +

    Some features from Ecmascript 2015 (E6) and Ecmascript 2016 (E7) are implemented:

    TypedArray support is based on Khronos TypedArray specification with some @@ -75,9 +73,10 @@ features (some are visible to applications, while others are internal):

  • Khronos/ES6 TypedArray and Node.js Buffer bindings, plain buffer type (lightweight ArrayBuffer)
  • -
  • Borrowed from ES6: setPrototypeOf/__proto__, +
  • From Ecmascript 2015 (E6): setPrototypeOf/__proto__, a subset of Proxy objects, computed property names, and minimal const support
  • +
  • From Ecmascript 2016 (E7): exponentiation operator (**, **=)
  • Duktape specific built-ins: provided by the Duktape global object
  • Extended types: custom "buffer" and "pointer" types, extended string type which supports arbitary binary strings and @@ -155,7 +154,8 @@ 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 E6 features (features borrowed from ES6), +Ecmascript 2015 (E6) features (features implemented from ES6), +Ecmascript 2016 (E7) features (features implemented from ES7), Custom behavior (behavior differing from standard), Custom JSON formats, Custom directives, diff --git a/website/index/index.html b/website/index/index.html index 4c4507b6..57341d38 100644 --- a/website/index/index.html +++ b/website/index/index.html @@ -39,8 +39,9 @@ Duktape API to call Ecmascript functions from C code and vice versa.

  • Embeddable, portable, compact: can run on platforms with 192kB flash and 64kB system RAM
  • Ecmascript E5/E5.1 - compliant, some features borrowed from - Ecmascript E6
  • + compliant, some features implemented from + Ecmascript 2015 (E6) and + Ecmascript 2016 (E7)
  • Khronos/ES6 TypedArray and Node.js Buffer bindings
  • Built-in debugger
  • From 9bd620e2591b74a74fe2598b82a045557d036655 Mon Sep 17 00:00:00 2001 From: Sami Vaarala Date: Sun, 9 Oct 2016 01:31:00 +0300 Subject: [PATCH 2/3] README updates for ES6/ES7 features --- README.md | 3 ++- dist-files/README.rst | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 07c22e6d..be7eb6c5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ to call Ecmascript functions from C code and vice versa. Main features: * Embeddable, portable, compact -* Ecmascript E5/E5.1 compliant +* Ecmascript E5/E5.1 compliant, some features implemented from + Ecmascript 2015 (E6) and Ecmascript 2016 (E7) * Khronos/ES6 TypedArray and Node.js Buffer bindings * Built-in debugger * Built-in regular expression engine diff --git a/dist-files/README.rst b/dist-files/README.rst index dab8cfd1..0f7857f2 100644 --- a/dist-files/README.rst +++ b/dist-files/README.rst @@ -7,9 +7,10 @@ intended to be easily embeddable into C programs, with a C API similar in spirit to Lua's. Duktape supports the full E5/E5.1 feature set including errors, Unicode -strings, and regular expressions, a subset of E6 features (e.g. computed -property names and Proxy objects), Khronos/ES6 ArrayBuffer/TypedView, and -Node.js Buffer bindings. +strings, and regular expressions, a subset of Ecmascript 2015 (E6) and +Ecmascript 2016 (E7) features (e.g. computed property names, Proxy objects, +exponentiation operator), Khronos/ES6 ArrayBuffer/TypedView, and Node.js +Buffer bindings. Duktape also provides a number of custom features such as error tracebacks, additional data types for better C integration, combined reference counting From 12d73da20566167b0996d59935bf90e1de043b41 Mon Sep 17 00:00:00 2001 From: Sami Vaarala Date: Sun, 9 Oct 2016 03:28:42 +0300 Subject: [PATCH 3/3] ES7 exp operator config metadata typo fix --- config/config-options/DUK_USE_ES7_EXP_OPERATOR.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config-options/DUK_USE_ES7_EXP_OPERATOR.yaml b/config/config-options/DUK_USE_ES7_EXP_OPERATOR.yaml index 81fe7d97..502f10c3 100644 --- a/config/config-options/DUK_USE_ES7_EXP_OPERATOR.yaml +++ b/config/config-options/DUK_USE_ES7_EXP_OPERATOR.yaml @@ -5,6 +5,6 @@ tags: - ecmascript - ecmascript7 description: > - Support the ES7 exponentation operator (** and **=). This is optional + Support the ES7 exponentiation operator (** and **=). This is optional because the operator pulls in pow() which may have a significant footprint impact on bare metal platforms.