TC39 81st and 82nd Meeting (March and April)

7 views
Skip to first unread message

Yulia Startsev

unread,
May 10, 2021, 2:23:34 PM5/10/21
to firef...@mozilla.org
Hi everyone,

As mentioned in my last message, I will be grouping together the short and long TC39 meetings, so that the updates don't get too frequent.

Today, the notes from our most recent long format meeting were published.

Important links:
* Proposal Summaries and Comments from March: https://spidermonkey.dev/blog/2021/03/18/tc39.html
* Complete Notes: https://github.com/tc39/notes/tree/master/meetings/2021-04
* Proposal Summaries and Comments from April: https://spidermonkey.dev/blog/2021/05/10/tc39.html
* Complete Notes: https://github.com/tc39/notes/tree/master/meetings/2021-03


81st meeting:

The quick version:

Temporal, the long awaited time/date library, has conditionally advanced to stage 3. This comes with a warning, however, this proposal must not ship unflagged until IETF standardizes timezone/calendar string serialization formats. (See #1459) This means that Implementers can start work on making the proposal, and the API is stable, but we are waiting on another standards body. If you would like to try it ahead of time, they have created a cookbook and polyfill for experimentation.

Error cause, a new proposal, also advanced to stage 3. Error cause will help developers be descriptive about the reason why a certain error occurred. You can use it in the following pattern:

throw new Error('Error message Text', { cause: anotherError });

This should help make debugging nested errors more efficient. In Firefox, we had a non-standard second argument that is no longer in use, but there are no issues around web compatibility, as our implementation took a number and this will be an object.

A new, exciting proposal is Module Fragments presented by Daniel Ehrenberg. Module Fragments would allow bundlers to target a browser format that may in the future make bundling and working with modules on the web easier and more efficient. This proposal adds syntax which will allow the definition of multiple modules in one file.


82nd meeting:

The quick version:

In this TC39 meeting, the updates to JavaScript Classes around private state have moved to stage 4. Other proposals of note this meeting were proposals related to ArrayBuffers, notably resizable ArrayBuffers and a new proposal, introducing read-only ArrayBuffers and fixed views into ArrayBuffers. Read-only ArrayBuffers are not a new ArrayBuffer, but rather a way to freeze existing ArrayBuffers so that they are not modified accidentally. Fixed views into ArrayBuffers would have the goal of not exposing more than the intended view of an ArrayBuffer to a third party.

One of the interesting new proposals is Object.has or Object.hasOwn. This would supply developers with a convenient shorthand. The following:

let hasOwn = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);

if (hasOwn(object, "foo")) {
  console.log("has property foo");
}

could instead be written as:

if (Object.hasOwn(object, "foo")) {
  console.log("has property foo")
}

This is a tricky corner case, and this would simplify things.

Pattern matching was brought back with an update. The proposal has a number of champions now, and a new effort to cleanly define the syntax. The record/tuple champions brought a new proposal that would help align how mutable and immutable structures have symmetry in their methods.

Learning more:
If you are new to the standards world and want to learn more about TC39, you can take a look at the process document [1], and this slide deck that I did to explain the process [2].  We have also built a repository explaining how TC39 works [3].

If you want a Mozilla-specific take, I am doing a stream explaining how to read the specification and how SpiderMonkey works [4]. You can follow SpiderMonkey news through our newsletter [5].



[1]: https://tc39.es/process-document/
[2]: https://docs.google.com/presentation/d/1q6pCJVwgYV19gbvNdLtwMnQ6vMZKdqZY-cQ6CE5yH8Y/edit#slide=id.gc6fa3c898_0_0

[3]: https://github.com/tc39/how-we-work

[4]: https://hacks.mozilla.org/2020/06/compiler-compiler-working-on-a-javascript-engine/
[5]: https://mozilla-spidermonkey.github.io/blog/

Reply all
Reply to author
Forward
0 new messages