Hermes plans to target ECMAScript 2015 (ES6), with some carefully considered exceptions.
- Symbols (including most well-known Symbols)
- Iteration (with
[Symbol.iterator]
) for..of
loops- Array spread
- Object rest/spread
- Shorthand property and computed property on object literals
- Destructuring assignment (with array and object "rest" properties)
- Template string literals
- Generators (
function*
andyield
) - TypedArrays
- Arrow functions
- Optional chaining and nullish coalescing (
?.
and??
) - Reflection (
Reflect
andProxy
) starting from v0.7.0 - ES6 Promise (with incompatibilities documented below)
- All ES6 JS library functions
- Set/Map
- WeakSet/WeakMap
- ES6 String searching functions
- ES6 Array searching functions
let
andconst
(block scoped variables, with support for the temporal dead zone)- Classes and method definitions
- ES modules (
import
andexport
) Intl
API glue for Android has been added, in order to enable community contribution of a complete, spec-compliant implementation.- Async function (
async
andawait
). Symbol.prototype.description
(it's not fully spec-conformant yet.Symbol().description
should beundefined
but it's currently''
).
- Realms
with
statements- Local mode
eval()
(use and introduce local variables) Symbol.species
and its interactions with JS library functions- use of
constructor
property when creating new Arrays in Array.prototype methods Symbol.unscopables
(Hermes does not supportwith
)- Other features added to ECMAScript after ES6 not listed under "Supported"
Function.prototype.toString
cannot show source because Hermes executes from bytecodearguments
changes in non-strict mode will not sync with named parametersPromise
is implemented by pre-compiling the JS polyfill from RN as the internal bytecode to preserve the current interoperation, hence its conformance to the spec is up to conformance of the polyfill.- In case you want to bring in your own Promise and opt-out Hermes', you can turn it off by passing
-Xes6-promise=0
in CLI or settingwithES6Promise(false)
in the runtime configs. - N.B. ES6 Promise does not include
Promise.allSettled
(ES2020) andPromise.any
(Stage 4).
- In case you want to bring in your own Promise and opt-out Hermes', you can turn it off by passing