| id | language-features |
|---|---|
| title | Language Features |
Hermes plans to target ECMAScript 2015 (ES6), with some carefully considered exceptions.
- Symbols (including most well-known Symbols)
- Iteration (with
[Symbol.iterator]) for..ofloops- 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 (
ReflectandProxy) starting from v0.7.0 Intl, or Internationalization APIs- currently Android only
- ES6 Promise (with incompatibilities documented below)
- All ES6 JS library functions
- Set/Map
- WeakSet/WeakMap
- ES6 String searching functions
- ES6 Array searching functions
letandconst(block scoped variables, with support for the temporal dead zone)- Classes and method definitions
- ES modules (
importandexport) IntlAPI glue has been added to enable community contribution of a complete, spec-compliant implementation on multiple platforms- Async function (
asyncandawait). Symbol.prototype.description(it's not fully spec-conformant yet.Symbol().descriptionshould beundefinedbut it's currently'').
- Realms
withstatements- Local mode
eval()(use and introduce local variables) Symbol.speciesand its interactions with JS library functions- use of
constructorproperty 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.toStringcannot show source because Hermes executes from bytecodeargumentschanges in non-strict mode will not sync with named parametersPromiseis 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=0in 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