-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Editorial: add a note about synchronicity of SyntheticModule Evaluate #3640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
6f066a8
to
896bce8
Compare
spec.html
Outdated
</emu-alg> | ||
|
||
<emu-note> | ||
<p>The returned promise should always be settled. In InnerModuleEvaluation, a non Cyclic Module Record is evaluated with EvaluateModuleSync, and asserted to return a settled promise.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That the returned promise here is always settled is obvious, because the second-to-last line calls Call(_pc_.[[Resolve]], *undefined*, « *undefined* »)
.
However, what we should do is enforce that all non-Cyclic module records must always return a settled promise. I suggest doing it in the Evaluate description at https://tc39.es/ecma262/#table-abstract-methods-of-module-records, so that if hosts provide their own module types they must also follow that requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, updated!
896bce8
to
055d4e6
Compare
<td> | ||
<p>Returns a promise for the evaluation of this module and its dependencies, resolving on successful evaluation or if it has already been evaluated successfully, and rejecting for an evaluation error or if it has already been evaluated unsuccessfully. If the promise is rejected, hosts are expected to handle the promise rejection and rethrow the evaluation error.</p> | ||
<p>Link must have completed successfully prior to invoking this method.</p> | ||
<p>A non Cyclic Module Record must always returns a settled promise. This is asserted in InnerModuleEvaluation, and a non Cyclic Module Record is evaluated with EvaluateModuleSync.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<p>A non Cyclic Module Record must always returns a settled promise. This is asserted in InnerModuleEvaluation, and a non Cyclic Module Record is evaluated with EvaluateModuleSync.</p> | |
<p>A non Cyclic Module Record must always returns a settled promise.</p> |
From a host point view the only thing that matters is what they have to do, and not what algorithms would break if they don't. Similarly, for "Link must have completed successfully prior to invoking this method" we do not say that that's asserted in step 2 of Evaluate.
(and if we do need to link, we should do it so through <emu-xref>
so that it stays up to date)
It is not clear if a Synthetic Module's
[[EvaluationSteps]]
should be sync or not by reading the steps in Synthetic Module'sEvaluate
algorithm solely.The synchronicity of a Synthetic Module's Evaluate steps is asserted in
EvaluateModuleSync
.Add a note at Synthetic Module Evaluate abstract operation about the synchronicity.