tc39 / ecma262

Status, process, and documents for ECMA-262
https://tc39.es/ecma262/
Other
14.85k stars 1.27k forks source link

Editorial: Explicitly track async evaluation order of pending modules #3353

Open nicolo-ribaudo opened 2 weeks ago

nicolo-ribaudo commented 2 weeks ago

The execution order of modules that were waiting on a given async module was based on the order in which their [[AsyncEvaluation]] field was set to true.

This PR replaces the [[AsyncEvaluation]] boolean with an actual number that keeps track of ordering in each agent. It also adds a note on when it's safe to reset this order to 0, since:

You can verify the numbers in the updated tables for the example using https://nicolo-ribaudo.github.io/es-module-evaluation/.

Fixes https://github.com/tc39/ecma262/issues/3289