ECMAScript 2019: The features are fixed!


The new features for ECMAScript 2019 have been fixed. Although the new JavaScript standard will not be released until the summer, it is already clear which 8 new features the version will standardize and which feature will receive an update.

Nine new and changed features are standardized with ECMAScript 2019. The new standard will be released in the summer. Already this week, however, the TC39 has finally decided which features will be included. Four of them had been stuck for a while, and four were placed on Stage 4 of the TC39 trial and declared ready. In addition, a feature that already exists in the standard is changed. All in all, nine new and changed features have been created in ECMAScript 2019.

Already in May 2018 it had been decided that the proposal for optional catch bindings in ECMAScript 2019 would be standardized, as well as the change of some definitions in ECMAScript, so that the language core would be a superset of JSON. Two more features followed in the TC39 November meeting: Symbol.prototype.description and a revision for Function.prototype.toString were set to level 4 of the TC39 proposal process. The following four Proposals has the TC39 now set to level 4 in January, so marked as ready:ready:

  • Object.fromEntries
  • Well-formed JSON.stringify
  • String.prototype.{trimStart,trimEnd}
  • Array.prototype.{flat,flatMap}

The most controversial feature below is Array.prototype. {flat, flatMap}. The term flat is now standardized after flatten first used, but this caused problems with the implementation. A not-so-serious suggestion of using smoosh instead triggered an outcry in the JavaScript world last year. The TC39 November meeting also discussed the issue of a problem that had occurred with flat Stage 3 implementation. In this respect, it was unclear until the January meeting to what extent an implementation in the standard can take place in 2019. This has now been confirmed.

9 features for ECMAScript 2019

With the static method Object.fromEntries , which can also be found on Bynen’s list, a list of key-value pairs can be transformed into an object. The proposal gives the following example:

obj = Object.fromEntries([['a', 0], ['b', 1]]); // { a: 0, b: 1 }

The proposal for JSON.stringify refers to the output of Unicode strings, which in the future will no longer contain characters not represented in UTF-8. This is to prevent the output of incorrect Unicode strings via JSON.stringify.

String.prototype.{trimStart,trimEnd} is an addition to the already standardized String.prototype.trim. According to the proposal text, trimLeft and trimRight have already been implemented in all major engines without any standardization. Standardized in ECMAScript 2019 is now trimStart and trimEnd, the example of padStart/padEnd . trimLeft/trimRight are called trimLeft/trimRight in the corresponding GitHub repository for the proposal.

Array.prototype.sort now stable

The last of the new features is the stable implementation of Array.prototype.sort. This is not a new feature in the standard, but a change to the existing standardization. Further information can be found in the pull request of Mathias Bynens.

The TC39 is a technical committee of the standardization organization ECMAInternational. Members of the committee include many representatives of the big webtech companies. Last year, npm announced that it would also be represented in TC39 in the future. The TC39 meets every two months and develops the JavaScript standard ECMAScript. Proposals go through four stages. Speech features proposed for standardization are included at level 1; Level 3 is implemented in JavaScript engines. Proposals that reach Level 4 by the January meeting of a year will be added to the standard in the same year. However, as stressed by Bynens on Twitter, for developers, especially the implementation in the Enginges is relevant, not so much the version number, to which a feature is included in the standard.

An overview of the proposals for ECMAScript 2019 is given in the list of finished proposals of the TC39 on GitHub.

Share This:

Comments are closed.

Powered by FrontNet