Skip to content

Commit

Permalink
Explicitly track async evaluation order of pending modules
Browse files Browse the repository at this point in the history
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.

I currently updated the example tables to just say that
[[AsyncEvaluationOrder]] is set to "an integer" rather than *true*. In the
next few days I'll update them to show the actual integer, but I first
need to update https://nicolo-ribaudo.github.io/es-module-evaluation/ to
verify that I'm not getting it wrong.
  • Loading branch information
nicolo-ribaudo committed Jun 14, 2024
1 parent 4e32b34 commit d600852
Showing 1 changed file with 65 additions and 46 deletions.
Loading

0 comments on commit d600852

Please sign in to comment.