Navigation
Recherche
|
ECMAScript 2025 JavaScript standard takes shape
samedi 29 mars 2025, 00:07 , par InfoWorld
ECMAScript 2025, the next version of an ECMA International standard for JavaScript, will standardize new JavaScript capabilities ranging from JSON modules to import attributes, new Set methods, sync iterator helpers, and regular expression modifiers.
The ECMAScript 2025 specification most likely be finalized in June. All told, nine finished proposals on the ECMAScript development committee’s GitHub page are designated as expected to be published this year. Another proposal slated for 2025, for time duration formatting objects, appears on a different page. Development of ECMAScript is under the jurisdiction of the ECMA International Technical Committee 39 (TC39). For JSON modules, the proposal calls for importing JSON files as modules. This plan builds on the import attributes proposal to add the ability to import a JSON module in a common way across JavaScript environments. For regular expressions, meanwhile, the regular expression escaping proposal is intended to address a situation in which developers want to build a regular expression out of a string without treating special characters from the string as special regular expression tokens, while the regular expression pattern modifiers provides the capability to control a subset of regular expression flags with a subexpression. Modifiers are especially helpful when regular expressions are defined in a context where executable code cannot be evaluated, such as a JSON configuration file of a Textmate language grammar file, the proposal states. Also in the “regex” vein, the duplicate named capturing groups proposal allows regular expression capturing group names to be repeated. Prior to this proposal, named capturing groups in JavaScript were required to be unique. The sync iterator helpers proposal involves having several interfaces to help with general usage and consumption of iterators in ECMAScript. Iterators are a way to represent large or possibly infinite enumerable data sets. Other proposals lined up for ECMAScript 2025 include: DurationFormat objects, an ECMAScript API specification proposal. Motivating this proposal is that users need all types of time duration formatting depending on the requirements of their application. Specifications and a reference implementation for Promise.try, which allows optimistically synchronous but safe execution of a function, and being able to work with a Promise afterward. It mirrors the async function. Float 16 on TypedArrays, DataView, and Math.f16round, which adds float16 (aka half-precision or binary16) TypedArrays to JavaScript. This plan would add a new kind of TypedArray, Float16Array, to complement the existing Float32Array and Float64Array. It also would add two new methods on DataView for reading and setting float16 values, as getFloat16 and setFloat16, to complement the existing similar methods for working with full and double precision floats. Also featured is Math.f16round, to complement the existing Math.fround. Among the benefits of this proposal is its usefulness for GPU operations. Import attributes, which provide syntax to import ECMAScript modules with assertions. An inline syntax for module import statements would pass on more information alongside the module specifier. The initial application for these attributes will be to support additional types of modules across JavaScript environments, beginning with JSON modules. Set methods for JavaScript, which add methods like union and intersection to JavaScript’s built-in Set class. Methods to be added include Set.prototype.intersection(other), Set.prototype.union(other), Set.prototype.difference(other), Set.prototype.symmetricDifference(other), Set.prototype.isSubsetOf(other), Set.prototype.isSupersetOf(other), Set.prototype.isDisjointFrom(other). These methods would require their arguments to be a Set, or at least something that looks like a Set in terms of having a numeric size property as well as keys and has methods. The development of the ECMAScript language specification started in November 1996, based on several originating technologies including JavaScript and Microsoft’s JScript. Last year’s ECMAScript 2024 specification included features such as resizing and transferring ArrayBuffers and SharedArrayBuffers and more advanced regular expression features for working with sets of strings.
https://www.infoworld.com/article/3856449/ecmascript-2025-javascript-standard-takes-shape.html
Voir aussi |
56 sources (32 en français)
Date Actuelle
mar. 1 avril - 00:52 CEST
|