Skip to content

Commit 84651de

Browse files
nidhijajuchromium-wpt-export-bot
authored andcommitted
ReadableStream: Reject pending reads when releasing reader
Previously, calling releaseLock() on ReadableStreamDefaultReader or ReadableStreamBYOBReader while there are pending read requests would throw a TypeError. The specification has been changed[1] to allow this case, and to reject such pending read requests with a TypeError instead. [1] whatwg/streams#1168 Bug: 1287273 Change-Id: Id4013571212e20b0d6ecccdcf68cd6d3927d38b2
1 parent 36fc6e2 commit 84651de

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

streams/readable-byte-streams/respond-after-enqueue.any.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ promise_test(async () => {
3636
assert_array_equals(value, [1, 2, 3], 'value should be 3 bytes');
3737
}, 'byobRequest.respond() with cached byobRequest after enqueue() should not crash');
3838

39-
promise_test(async () => {
39+
promise_test(async t => {
4040
const rs = new ReadableStream({
4141
type: 'bytes',
4242
autoAllocateChunkSize: 10,
@@ -47,9 +47,5 @@ promise_test(async () => {
4747
});
4848

4949
const reader = rs.getReader();
50-
const [read1, read2] = await Promise.all([reader.read(), reader.read()]);
51-
assert_false(read1.done, 'read1.done should not be true');
52-
assert_array_equals(read1.value, [1, 2, 3], 'read1.value should be 3 bytes');
53-
assert_false(read2.done, 'read2.done should not be true');
54-
assert_array_equals(read2.value, [0, 0], 'read2.value should be 2 bytes');
50+
await promise_rejects_js(t, TypeError, Promise.all([reader.read(), reader.read()]));
5551
}, 'byobRequest.respond() after enqueue() with double read should not crash');

0 commit comments

Comments
 (0)