Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dc99ae3

Browse filesBrowse files
jasnelltargos
authored andcommitted
stream: fix the ReadableStreamBYOBReader error message
PR-URL: #40846 Reviewed-By: Robert Nagy <ronagy@icloud.com>
1 parent 65b33ba commit dc99ae3
Copy full SHA for dc99ae3

File tree

Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed
Open diff view settings
Collapse file

‎lib/internal/webstreams/readablestream.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/readablestream.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ class ReadableStream {
508508
return customInspect(depth, options, this[kType], {
509509
locked: this.locked,
510510
state: this[kState].state,
511+
supportsBYOB:
512+
this[kState].controller instanceof ReadableByteStreamController,
511513
});
512514
}
513515

@@ -1745,7 +1747,7 @@ function setupReadableStreamBYOBReader(reader, stream) {
17451747
controller,
17461748
} = stream[kState];
17471749
if (!isReadableByteStreamController(controller))
1748-
throw new ERR_INVALID_ARG_VALUE('reader', reader, 'must be a byte stream');
1750+
throw new ERR_INVALID_ARG_VALUE('stream', stream, 'must be a byte stream');
17491751
readableStreamReaderGenericInitialize(reader, stream);
17501752
reader[kState].readIntoRequests = [];
17511753
}
Collapse file

‎test/parallel/test-whatwg-readablestream.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-whatwg-readablestream.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,10 +1410,12 @@ class Source {
14101410

14111411
assert.strictEqual(
14121412
inspect(readable),
1413-
'ReadableStream { locked: false, state: \'readable\' }');
1413+
'ReadableStream { locked: false, state: \'readable\', ' +
1414+
'supportsBYOB: false }');
14141415
assert.strictEqual(
14151416
inspect(readable, { depth: null }),
1416-
'ReadableStream { locked: false, state: \'readable\' }');
1417+
'ReadableStream { locked: false, state: \'readable\', ' +
1418+
'supportsBYOB: false }');
14171419
assert.strictEqual(
14181420
inspect(readable, { depth: 0 }),
14191421
'ReadableStream [Object]');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.