You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 29, 2021. It is now read-only.
B: no deps, [[ModuleAsync]] = false, fails when executing
We run A.Instantiate() with no issues. All [[Status]] fields are "instantiated".
We then run A.Evaluate(). B.ExecuteModule() returns an abrupt completion, which is passed through InnerModuleEvaluation(B) (step 12.a) and InnerModuleEvaluation(A) (step 11.c) back to A.Evaluate(). At this point, stack is [A, B] and all modules have [[Status]] set to "evaluating". Because we encounter the async module A in stack, we return early, without setting the [[Status]] fields to "evaluated".
This violates the claim above the algorithm:
Evaluate transitions this module's [[Status]] from "instantiated" to "evaluated".
and makes it impossible to call Evaluate() again, because of:
Assert: module.[[Status]] is "instantiated" or "evaluated".
The text was updated successfully, but these errors were encountered:
Well, oops, good catch. The early return is intended to stop iterating up the stack when the Promise reactions would carry things through. Sounds like it needs some rethinking for this sync -> async transition. Note, all this logic would be done differently in #71.
The early return at 5. (a) (ii) is a bug in this spec, and that line should be removed. All items on the stack should be transitioned to evaluated on error, as that code block achieves.
I actually already included that one line fix in #71.
https://tc39.github.io/proposal-top-level-await/#sec-moduleevaluation
Consider the following modules:
We run
A.Instantiate()
with no issues. All [[Status]] fields are "instantiated".We then run
A.Evaluate()
.B.ExecuteModule()
returns an abrupt completion, which is passed throughInnerModuleEvaluation(B)
(step 12.a) andInnerModuleEvaluation(A)
(step 11.c) back toA.Evaluate()
. At this point, stack is [A, B] and all modules have [[Status]] set to "evaluating". Because we encounter the async module A in stack, we return early, without setting the [[Status]] fields to "evaluated".This violates the claim above the algorithm:
and makes it impossible to call
Evaluate()
again, because of:The text was updated successfully, but these errors were encountered: