| id | language-features |
|---|---|
| title | Language Features |
Hermes plans to target ECMAScript 2015 (ES6), with some carefully considered exceptions.
- All ES6 JS library functions
- ES6 Array searching functions
- ES6 String searching functions
- Set/Map
- WeakSet/WeakMap
- Array spread
- Arrow functions
- BigInt
- Destructuring assignment (with array and object "rest" properties)
- ES6 Promise (with incompatibilities documented below)
for..ofloops- Generators (
function*andyield) Intl, or Internationalization APIs- Iteration (with
[Symbol.iterator]) - Object rest/spread
- Optional chaining and nullish coalescing (
?.and??) - Reflection (
ReflectandProxy) starting from v0.7.0 - Shorthand property and computed property on object literals
- Symbols (including most well-known Symbols)
- Template string literals
- TypedArrays
- Async function (
asyncandawait). - ES modules (
importandexport) IntlAPI glue has been added to enable community contribution of a complete, spec-compliant implementation on multiple platformsSymbol.prototype.description(it's not fully spec-conformant yet.Symbol().descriptionshould beundefinedbut it's currently'').- WeakRef
- Block scoped variables (
letandconst), with support for the temporal dead zone - Classes and method definitions
- Expanded Intl functionality (e.g., DisplayNames, ListFormat, PluralRules, RelativeTimeFormat, and Locale)
- RegExp match indices and named capture groups
- Local mode
eval()(use and introduce local variables) - Other features added to ECMAScript after ES6 not listed under "Supported"
- Realms
Symbol.speciesand its interactions with JS library functionsSymbol.unscopables(Hermes does not supportwith)- use of
constructorproperty when creating new Arrays in Array.prototype methods withstatements
argumentschanges in non-strict mode will not sync with named parametersFunction.prototype.toStringcannot show source because Hermes executes from bytecodePromiseis 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.
- In case you want to bring in your own Promise and opt-out Hermes', you can turn it off by passing