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:
implementations might want to prevent this number from overflowing, and V8 currently has a bug that resets the number to 0 too early
figuring out when it's safe to reset the number might not be trivial, given the complexity of the module algorithms.
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