Skip to content
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

Handle conversion failures in 'upon settling'. #791

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ms2ger
Copy link
Member

@Ms2ger Ms2ger commented Sep 3, 2019

Fixes #782.


Preview | Diff

And then, if <a lt="an exception was thrown">an exception |exception| was thrown</a>:

1. If there are steps that are required to be run if the promise was rejected, let
|result| be the result of performing those steps, given |exception|.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|result| is unused. Should it be returned, instead of throwing exception?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, good question. This matters if:

  1. we want to do a type conversion
  2. the returned promise is used (former "transforming")
  3. we want to do something else than passing the rejection along

Are you aware of an existing case to inform the decision? From #782 (comment), waitUntil/complete fail (1), respondWith/updateWith fail (2), WebAssembly fails (3).

Writing this, I'm realizing that we never actually pass the rejection along, the way WebAssembly needs. Should we pass undefined instead of onRejectedSteps if there's no steps?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you aware of an existing case to inform the decision?

I'm not aware of any. However I generally think aligning with promise.then() will be more intuitive for spec authors, if we have that degree of freedom. So I'd prefer that if possible.

Writing this, I'm realizing that we never actually pass the rejection along, the way WebAssembly needs. Should we pass undefined instead of onRejectedSteps if there's no steps?

Definitely.

@annevk
Copy link
Member

annevk commented Apr 30, 2020

@Ms2ger do you plan to complete this?

@Ms2ger
Copy link
Member Author

Ms2ger commented Jul 17, 2020

Probably not.

@domenic domenic self-assigned this Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Promise handling algorithms are not very clear about what happens if type conversion fails
3 participants