1 of 6

Top-Level Await for Stage 4 The Await is Over (or is it?)

Yulia Startsev - TC39 May, 2021

2 of 6

Quick Refresh

  • Top-level await enables modules to act as big async functions: With top-level await, ECMAScript Modules (ESM) can await resources, causing other modules who import them to wait before they start evaluating their body.

3 of 6

What has changed since March?

  • Editorial change introducing prose with an example of what happens when there is an error in an async module graph. You can read all about it here.
  • Spec readability PR. This introduces a new state - evaluating-async, between evaluating and evaluated. The change is editorial but reduces potential misreadings.
  • Open issues

4 of 6

Current status

  • Test262 acceptance tests have been written for mainline usage scenarios, and merged.
  • Two compatible implementations which pass the acceptance tests
  • Integrated spec text
  • ⏹ The ECMAScript editor has signed off on the pull request

5 of 6

Stage 4?

6 of 6

Massive thank you to Guy Bedford, Ms2ger, Dan Ehrenberg, Tobias Koppers, Jason Orendorff, and everyone else who helped get this across the finish line!