Socket
Socket
Sign inDemoInstall

Security News

TC39 Advances Key Proposals: Deferred Import Evaluation, Error.isError(), RegExp Escaping, Promise.try

Ecma TC39 is meeting this week and has moved key ECMAScript proposals forward, advancing Deferred Import Evaluation, Error.isError(), RegExp Escaping, and Promise.try to the next stages.

TC39 Advances Key Proposals: Deferred Import Evaluation, Error.isError(), RegExp Escaping, Promise.try

Sarah Gooding

June 11, 2024


Ecma TC39 (Technical Committee 39) delegates are in Finland this week for their 102nd meeting that is happening over the course of three days, hosted by Mozilla and Aalto University. They are also speaking at local events and conferences during the week.

TC39 is responsible for developing and maintaining the ECMAScript programming language specification. The committee operates on a consensus basis and has the authority to modify the specification as deemed necessary. Minor changes to ECMAScript can be submitted by filing a PR against the ECMA-262 standard repository, but major feature requests happen through a proposal process.

Today several proposals received consensus to advance to the next stage. (The TC39 proposal process includes six stages: a strawperson stage and five “maturity” stages.) Here’s a quick overview of the ones approved on the first day:

Deferred Import Evaluation Moves to Stage 2.7#

Deferring Import Evaluation, previously known as “Lazy Module Initialization,” aims to allow JavaScript imports to be loaded without immediate evaluation. This would enable better performance optimizations by deferring the execution of imported modules until they are explicitly needed in the code.

This change has the potential to improve the performance of large applications by reducing initial load times and avoiding unnecessary CPU work during application initialization. The slides for the presentation on moving the proposal to Stage 2.7 are available as a Google slideshow.

Error.isError() Moves to Stage 2#

The Error.isError proposal introduces a new method for developers to test if a value is an error instance. The potential use cases cited in the proposal include:

  • debugging: it is very helpful to humans, even if not always to programs, to know what kind of thing a value is. Knowing if something is a "real" native error is thus valuable information to make available, including to error-reporting libraries.
  • serialization: platforms such as RunKit need to serialize values safely and reconstruct them or describe them in the user’s browser. brand checking is critical for this.
  • structuredClone: this HTML method, which is also in node, brand-checks, and has special behavior for native Errors. JS programs need a way to know in advance if this behavior will be applied

RegExp Escaping Moves to Stage 2.7#

The RegExp Escaping proposal would introduce a RegExp.escape static function, allowing strings to be escaped so they can be safely used inside regular expressions.

Promise.try Moves to Stage 3#

The Promise.try proposal suggests adding 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.

More Proposal Advancements Coming This Week#

Today is the first day for agenda items, and there are two more days where the committee plans to discuss and approve new features moving forward through the proposal stages. Other proposed advancements on deck this week include the following:

The committee will also be discussing progress on other proposals without stage advancement:

All open ECMAScript proposals and their current stages are tracked in a table on GitHub with their most recent presentation dates and responsible parties. This document has already been updated with today’s advancements.

For a full overview of the discussion topics, including those unrelated to proposals, check out the agenda for the 102nd meeting of Ecma TC39 on GitHub.

Subscribe to our newsletter

Get notified when we publish new security blog posts!

Related posts

Back to all posts
SocketSocket SOC 2 Logo

Product

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc