-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fetch/XHR/Beacon: test locked/disturbed ReadableStream #12639
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from this end for the sendBeacon portion. Although, I'd love to get @yutakahirano sanity check too.
@@ -0,0 +1,23 @@ | |||
function assert_beacon(stream) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beacon with streams is never going to work because it's keepalive + ReadableStream which is rejected by another reason.
@yutakahirano good point, fixed. |
|
||
function assert_request(input, init) { | ||
assert_throws(new TypeError(), () => new Request(input, init), "new Request()"); | ||
assert_throws(new TypeError(), () => fetch(input, init), "fetch()"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because fetch never throws. Maybe we should make all tests asynchronous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my, thanks for spotting that.
I think I fixed that too. |
This also introduces "safely extract" which mainly serves to make it explicit which extraction operations cannot throw. Tests: web-platform-tests/wpt#12639. Fixes #792.
See whatwg/fetch#801 for context.