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

"If flushPromise was rejected with reason r, the..." #1262

Open
ricea opened this issue Mar 23, 2023 · 1 comment
Open

"If flushPromise was rejected with reason r, the..." #1262

ricea opened this issue Mar 23, 2023 · 1 comment

Comments

@ricea
Copy link
Collaborator

ricea commented Mar 23, 2023

https://streams.spec.whatwg.org/commit-snapshots/b45c0c5a6c66c73c1e17254976e8a271aecc5592/#transform-stream-default-sink-close-algorithm

If flushPromise was rejected with reason r, then:​

Perform ! TransformStreamError(stream, r).

Throw readable.[[storedError]].

This may throw an undefined value if readable is closed when the microtask runs after flushPromise is rejected. Maybe we should do something like

  1. Let error be readable.[[storedError]] if readable.[[state]] is "errored", or r otherwise.
  2. Throw error.

What do you think?

@domenic
Copy link
Member

domenic commented Mar 24, 2023

I think I need more detail on the scenario you're envisioning. I guess there are two errors here, readable.[[storedError]] and r, and we need to decide which to throw? An example with the two errors being different values, and where the chosen value currently shows up, would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants