-
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
Streams: reject pending reads when releasing reader #32072
Streams: reject pending reads when releasing reader #32072
Conversation
5c4df18
to
04f6e39
Compare
}, 'ReadableStream with byte source: respondWithNewView() throws if the supplied view has a different offset ' + | ||
'(in the readable state)'); |
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.
Drive-by fix: I noticed that this check was not covered by any tests, so I added one. 🙂
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
const read2 = reader2.read(new Uint8Array([4, 5])); | ||
assert_not_equals(controller.byobRequest, null, 'byobRequest should not be invalidated after releaseLock()'); | ||
assert_equals(controller.byobRequest, byobRequest1, 'byobRequest should be unchanged'); | ||
assert_array_equals([...new Uint8Array(byobRequest1.view.buffer)], [1, 2, 3], 'byobRequest.view.buffer should be unchanged'); |
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.
I think it's not necessary to unwrap the Uint8Array with [...]
. assert_array_equals doesn't check the types of the arguments are equal.
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.
It matters for format_value()
though, when the array ends up in an error message. 🤔
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.
Ah, interesting.
See whatwg/streams#1168 for the accompanying spec change.