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
I believe there's a problem with how rejected promises for evaluation errors of non-Cyclic (i.e. Synthetic) Module Records are handled w.r.t. HostPromiseRejectionTracker in InnerModuleEvaluation ( module, stack, index ):
1. If _module_ is not a Cyclic Module Record, then
a. Let _promise_ be ! _module_.Evaluate().
b. Assert: _promise_.[[PromiseState]] is not ~pending~.
c. If _promise_.[[PromiseState]] is ~rejected~, then
i. Return ThrowCompletion(_promise_.[[PromiseResult]]).
In case of an evaluation error, this code will just unwrap the promise and throw the error, not notifying any HostPromiseRejectionTracker hook that the promise has been handled. OTOH, Evaluate() (presumably) will have already performed RejectPromise (via IfAbruptRejectPromise) and called HostPromiseRejectionTracker(promise, "reject") since [[PromiseIsHandled]] is false. If my understanding is correct, the promise rejection would thus falsely appear to be unhandled.
This code path isn't actually reachable in the spec as of now, but will be when JSON Modules, and thus Synthetic Module Records, land (i.e. #3391).
The text was updated successfully, but these errors were encountered:
Non-cyclic module records are all synchronous, and the fact that they return a promise is purely a spec artifact (hence why the assertion that the promise is already settled).
Maybe we should just remove the "fake promise" from there.
It might still make sense to have the promise for ContinueDynamicImport, step 6.c. Let evaluatePromise be module.Evaluate().
Maybe this could be layered differently, though, idk.
I believe there's a problem with how rejected promises for evaluation errors of non-Cyclic (i.e. Synthetic) Module Records are handled w.r.t. HostPromiseRejectionTracker in
InnerModuleEvaluation ( module, stack, index ):
In case of an evaluation error, this code will just unwrap the promise and throw the error, not notifying any
HostPromiseRejectionTracker
hook that the promise has been handled. OTOH,Evaluate()
(presumably) will have already performed RejectPromise (via IfAbruptRejectPromise) and calledHostPromiseRejectionTracker(promise, "reject")
since [[PromiseIsHandled]] is false. If my understanding is correct, the promise rejection would thus falsely appear to be unhandled.This code path isn't actually reachable in the spec as of now, but will be when JSON Modules, and thus Synthetic Module Records, land (i.e. #3391).
The text was updated successfully, but these errors were encountered: