Now that we have done T272104: Allow modules to opt-in to ES6 syntax support, we should consider doing the same thing for ES2016, ES2017, or whatever version makes sense.
We will have to consider the benefits of new language features in a given ES version versus the costs of dropping browsers that don't support it, and the complexity of feature detection.
Notable syntax features in later versions:
- ES2016: the ** operator.
- ES2017:
- async function declarations.
- await statements.
- async function expressions.
- async function methods.
- ES2018: async iteration (for await), spread (...) in object literals, regex features (named capture groups, lookbehind, /s flag, \p{...})
- ES2019: optional catch binding.
- ES2020: ?? nullish and ?. operators, dynamic import, import.meta, export * as Foo from 'bar', BigInt.