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.
In #99, I disabled a few WPT tests for
pipeTo()
because the public reader/writer API isn't powerful enough to implement all of the spec details. For example, it's not possible to synchronously detect if the stream starts out closed or errored using onlyreader.closed
andwriter.closed
, but the WPT tests do demand this precision.With this PR, we compromise. We still use the public API as much as possible, for maximum compatibility. However, if the given streams are created by the polyfill itself, then we use some internal fields and abstract ops where no other alternative is available. Currently, that's the case for:
writer.close()
was called beforepipeTo()
, i.e. forWritableStreamCloseQueuedOrInFlight()
.(We still have the cheating test though. I still think the test is wrong, so I'm not going to try to make the polyfill pass it. 😛)