ecma262 icon indicating copy to clipboard operation
ecma262 copied to clipboard

Editorial: Remove incorrect setting of the AsyncEvaluation state to false

Open codehag opened this issue 2 years ago • 1 comments

This change removes an extraneous line that was included when this was originally merged into the spec, but did not reflect the spec that had consensus.

The line was removed (along with others) in this pr: https://github.com/tc39/proposal-top-level-await/commit/c2375dbd6ecb0d5e9a415f6a812fc0974a2935b7#diff-181371b08d71216599b0acccbaabd03c306da6de142ea6275c2135810999805aL697

Additionally, this is only set on the fulfilled state -- and not the rejected, so this is a mistake anyway. This could be seen as editorial or normative -- in either case this is a bug.

codehag avatar Jul 13 '22 12:07 codehag

I see that the previous spec text was inconsistent with the example execution, so in that sense something here should certainly be fixed.

I'm having trouble figuring out what if any the normative consequences of this are, though. Looking at InnerModuleEvaluation step 11.d.v, it looks like this change means that now when importing an already-evaluated async module we still increment the importer's [[PendingAsyncDependencies]]. But I don't see how control ever returns to the importer, in this case. We "Append module to requiredModule.[[AsyncParentModules]]", but if requiredModule is already finished evaluating, we're never going to traverse its [[AsyncParentModules]] again - that only happens when it transitions from not-finished to finished, as far as I can tell.

bakkot avatar Jul 13 '22 16:07 bakkot