id | title |
---|---|
language-features |
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..of
loops- Generators (
function*
andyield
) Intl
, or Internationalization APIs- Iteration (with
[Symbol.iterator]
) - Object rest/spread
- Optional chaining and nullish coalescing (
?.
and??
) - Reflection (
Reflect
andProxy
) 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 (
async
andawait
). - ES modules (
import
andexport
) Intl
API 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().description
should beundefined
but it's currently''
).- WeakRef
- Block scoped variables (
let
andconst
), 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.species
and its interactions with JS library functionsSymbol.unscopables
(Hermes does not supportwith
)- use of
constructor
property when creating new Arrays in Array.prototype methods with
statements
arguments
changes in non-strict mode will not sync with named parametersFunction.prototype.toString
cannot show source because Hermes executes from bytecodePromise
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.
- In case you want to bring in your own Promise and opt-out Hermes', you can turn it off by passing