Repository navigation
Report a promise rejection as uncaught only if it is still unhandled after the jobs around it - #524
Draft
wesgarland wants to merge 2 commits into
Draft
wesgarland wants to merge 2 commits into
wesgarland wants to merge 2 commits into
Conversation
…after the jobs around it promiseRejectionTracker reported every Unhandled rejection at once and ignored the Handled state, so a rejection handled through Promise.prototype.finally() (whose internal promise gets its handler a few jobs later) was reported as uncaught, and pmjs stopped and exited 1.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
promiseRejectionTrackerreported every rejection SpiderMonkey marked Unhandled straight away and ignored the Handled state.Promise.prototype.finally()rejects an internal promise that only gets its handler a few jobs later, sop.finally(f).catch(h)was reported asUncaughteven thoughhran, and pmjs then stopped its event loop and exited 1. dcp-client'sjob.exec()returns such a chain, so cancelling a job killed the program.call_later(0)runs after the jobs queued around them; a Handled notification in between removes them. The check is counted as a pending job, sopm.wait()waits for it.tests/js/finally-rejection-handled.simple: three rejections handled throughfinally(); fails on 1.5.1.tests/js/unhandled-rejection.bash: a rejection nobody handles is still reported and pmjs still exits non-zero; passes on 1.5.1 and must keep passing.Not built locally; CI is the first build.