Skip to content

Conversation

MattiasBuelens
Copy link
Contributor

See whatwg/streams#1168 for the accompanying spec change.

@MattiasBuelens MattiasBuelens force-pushed the reject-pending-reads-on-release branch from 5c4df18 to 04f6e39 Compare December 15, 2021 23:05
Comment on lines +218 to +219
}, 'ReadableStream with byte source: respondWithNewView() throws if the supplied view has a different offset ' +
'(in the readable state)');
Copy link
Contributor Author

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. 🙂

Copy link
Contributor

@ricea ricea left a 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');
Copy link
Contributor

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.

Copy link
Contributor Author

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. 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, interesting.

@domenic domenic merged commit 99d74f9 into web-platform-tests:master Jan 13, 2022
@MattiasBuelens MattiasBuelens deleted the reject-pending-reads-on-release branch January 13, 2022 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants