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 @@ -
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
.
Duktape supports some of the additional RegExp syntax defined in -ES6 Annex B.1.4.
- -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:
var
declarations, const
declarations are
- required to have an initializer.const
variables are
- not writable.var
declarations. In ES6 const
- has block scoping like let
.Computed property names are supported and allow syntax like
-{ [1 + 2]: "three" }
.
The 0o755
and 0b10001010
literal formats
-are supported. Legacy octal literals like 0755
are also
-supported.
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
-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.
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()
.
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:
Trap | Implemented | Notes |
---|---|---|
getPrototypeOf | no | |
setPrototypeOf | no | |
isExtensible | no | |
preventExtension | no | |
getOwnPropertyDescriptor | no | |
defineProperty | no | |
has | yes | Object.hasOwnProperty() does not invoke the trap at the moment, key in obj does. |
get | yes | |
set | yes | |
deleteProperty | yes | |
enumerate | no (*) | The "enumerate" trap was removed in ES7 and for-in uses "ownKeys" trap; Duktape 1.x supports "enumerate" trap in for-in. |
ownKeys | yes | Some trap result validation (non-configurable properties, non-extensible target) not yet implemented. |
apply | no | |
construct | no |
Limitations include:
-Object.defineProperty()
on a proxy object.ownKeys
trap result validation
- steps described in [[OwnPropertyKeys]] ()
- for non-configurable target properties and/or non-extensible target object are not
- yet implemented.new Proxy()
cannot
- be proxy objects themselves. ES6 poses no such limitation, but Duktape
- enforces it to simplify the internal implementation.Duktape implements Khronos typed array support which is a subset of ES6 -typed arrays.
- -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.
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
.
The **
and **=
operators are supported.
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 @@ + + + + + + + + + + + + + + +
Duktape implements features from ES2015 (ES6), ES2016 (ES7), and later +specification drafts. See Wiki article +Post-ES5 features +for current status.