-
Notifications
You must be signed in to change notification settings - Fork 12
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
Note shortpath for gather transitive async dependencies #36
Conversation
In which case module.[[Status]] is Also, does this short-circuiting also work in case of modules that error? e.g. // a
import defer * as b from "b"; // b
import "c";
throw new Error("Err!"); // c
await promise; assume that:
If GatherAsynchronousTransitiveDependencies returned [ b ], then |
During a cycle async evaluation - This was to maintain the invariant of cycle transitions happening together. Deferred evaluation may be an opportunity to reconsider these invariants as well. For failure, we have the current failure behaviours when importing a deferred module
Therefore in the transitive handler for a dynamic import, we must make sure to propagate (3) and (4) only, so yes the short path would only apply to I've updated the PR for the |
I don't think so. If you have a graph A->B where B has TLA, there are no strongly connected components (or, there are two strongly connected components with one node each), but A also transitions to NOTE 1 in https://tc39.es/ecma262/#sec-innermoduleevaluation also mentions that |
The "Tarjan guarantee" in the ES module system spec is the stack walk at the end of InnerModuleEvaluation where state transitions for a strongly connected component happen together for that entire component. When This is also the reason for having both evaluating-async and AsyncEvaluation. |
f5cf8a1
to
46d6e24
Compare
I realised I forgot to actually push the update here - I've done that now. |
dfeab10
to
da2a5e8
Compare
The change in #39 actually subsumes this short path anyway now. |
Given the complexity of TLA and the invariants, I thought it might be worth noting this one. I had to verify the logic quite carefully myself, and would value a second opinion if the short path does truly work. Feel free to ignore if it feels inappropriate to bring into the spec though.