Socket
Socket
Sign inDemoInstall

Security News

TC39 Advances 10+ ECMAScript Proposals: Key Features to Watch

TC39 is meeting in Tokyo this week and they have approved nearly a dozen proposals to advance to the next stages.

TC39 Advances 10+ ECMAScript Proposals: Key Features to Watch

Sarah Gooding

October 9, 2024


Ecma International, Technical Committee 39 (TC39) delegates gathered this week in Tokyo, hosted by Sony Interactive Entertainment, for one of its six plenary meetings that happen over the course of a year. The group is responsible for defining ECMAScript (JavaScript) and related standards and this was their 104th meeting.

During these meetings, the delegates consider proposals for advancement through a structured process that guides the evolution of an idea into a fully defined feature, including acceptance tests and multiple implementations. This process consists of six stages: an initial strawperson stage followed by five "maturity" stages, with committee approval required at each step.

Thanks to on-the-ground “ECMAScript excitement” updates from TC39 co-chair Rob Palmer, we have a general idea of how the current proposals are progressing. The agenda includes consideration of proposals for advancement, along with updates and discussion on other proposals in various stages.

Most of the proposals on the agenda have advanced to the next stages, with the exception of a few that will be discussed the following day.

Iterator Helpers to Stage 4#

The Iterator Helpers proposal has reached Stage 4, where the proposed feature is complete and ready to be included in the standard. No further changes will be made to the proposal. It will be merged into ECMA-262:

Iterators are a useful way to represent large or possibly infinite enumerable data sets. However, they lack helpers which make them as easy to use as Arrays and other finite data structures, which results in certain problems that could be better represented by iterators being expressed in Arrays, or using libraries to introduce the necessary helpers. The proposal introduces a collection of new methods on the Iterator prototype, to allow general usage and consumption of iterators.

Import Attributes & JSON Modules to Stage 4#

The Import Attributes & JSON Modules proposal has moved to Stage 4 where it will be included in the standard.

The Import Attributes proposal, formerly known as Import Assertions, adds an inline syntax for module import statements to pass on more information alongside the module specifier. The initial application for such attributes will be to support additional types of modules in a common way across JavaScript environments, starting with JSON modules.

Iterator Sequencing to Stage 2.7#

Iterator Sequencing is moving to Stage 2.7 where it is approved in principle and undergoing validation from tests, implementations, or usage. This proposal allows for creating iterators by sequencing existing iterators.

Regular Expression Modifiers to Stage 4#

Regular Expression Modifiers has reached Stage 4, and will be added to the standard. It allows you to change the active regular expression flags within a subexpression.

Structs & Shared Structs to Stage 2#

Structs and Shared Structs advanced to Stage 2, where the committee has chosen a preferred solution or solution space, but the design is a draft and may still change significantly.This proposal seeks to introduce four shared memory features that would enable new, high-performance applications to be written in JavaScript and on the web and give developers an alternative to classes that favors a higher performance ceiling and statically analyzability over flexibility.

Math.sumPrecise to Stage 3#

The Math.sumPrecise proposal has moved to Stage 3, where it has officially been recommended for implementation. It proposes adding a method to sum multiple values to JavaScript.

Extractors to Stage 2#

Extractors has moved to Stage 2 where the committee has chosen a preferred solution or solution space, but the design is a draft and may still change significantly. The proposal would introduce Extractors (a.k.a. "Extractor Objects") to ECMAScript that would augment the syntax for BindingPattern and AssignmentPattern to allow for new destructuring forms

Promise.try to Stage 4#

Promise.try has advanced to Stage 4 and will be included as part of the standard. The proposal adds a new feature in JavaScript called Promise.try. It would allow developers to wrap a function in a Promise for improved error handling, offering a more straightforward way to start promise chains. This method ensures that the function passed to it is executed immediately and returns a promise, making it easier to handle synchronous exceptions and asynchronous operations uniformly.

Atomics.pause to Stage 3#

Atomics.pause has moved to Stage 3 where it has officially been recommended for implementation:

For better spinning, add Atomics.pause(N). It performs a finite-time wait for a very short time that runtimes can implement with the appropriate CPU hinting. It has no observable behavior other than timing.
Unlike Atomics.wait, since it does not block, it can be called from both the main thread and worker threads.
Implementations are expected to implement a short spin with CPU yielding, using best practices for the underlying architecture. The non-negative integer argument N controls the pause time, with larger values of N pausing for longer. It can be used to implement backoff algorithms when the microwait itself is in a loop.

Error.isError to Stage 2.7#

Error.isError has advanced to Stage 2.7 where it is approved in principle and undergoing validation from tests, implementations, or usage. The proposal introduces a new method for developers to test if a value is an error instance.

Array.zip for Stage 1, or 2, or 2.7#

The Array.zip proposal will be discussed tomorrow and is expected to advance to Stage 1, 2, or 2.7. The proposal would add Array.zip and Array.zipKeyed static methods to the Array constructor.

Immutable ArrayBuffers for Stage 1#

The Immutable ArrayBuffers proposal will also be discussed tomorrow and is expected to advance to Stage 1 where the committee will devote time to examining the identified problem space, the full breadth of possible solutions, and cross-cutting concerns. This proposal follows previous successful proposals for In-Place Resizable and Growable ArrayBuffers and ArrayBuffer.prototype.transfer and friends. It seeks to enable the creation of an immutable buffer, i.e., a non-detached buffer whose contents cannot be changed, resized, or detached.

The committee will also be discussing various other topics and progress on other proposals without stage advancement, including the following:

  • AsyncContext
  • Dataview Clamped Methods
  • Decimal
  • Discard Bindings
  • ESM Phase Imports
  • Explicit Compile Hints
  • Intl.DurationFormat
  • JSSugar
  • Math.emplace
  • Measure Object
  • Observables
  • Porffor
  • Smart Units
  • Temporal

All open ECMAScript proposals and their current stages are tracked in a table on GitHub with their most recent presentation dates and responsible parties. If you want to follow along with the discussion topics, including those unrelated to proposals, check out the agenda for the 104nd meeting of Ecma TC39 on GitHub.

Subscribe to our newsletter

Get notified when we publish new security blog posts!

Try it now

Ready to block malicious and vulnerable dependencies?

Install GitHub AppBook a demo

Related posts

Back to all posts
SocketSocket SOC 2 Logo

Product

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc