mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
stream: fix the ReadableStreamBYOBReader error message
PR-URL: https://github.com/nodejs/node/pull/40846 Reviewed-By: Robert Nagy <ronagy@icloud.com>
This commit is contained in:
1 parent
65b33ba510
commit
dc99ae3bd6
2 files changed
+7
-3
No files matched your search
@@ -508,6 +508,8 @@ class ReadableStream {
|
||||
return customInspect(depth, options, this[kType], {
|
||||
locked: this.locked,
|
||||
state: this[kState].state,
|
||||
supportsBYOB:
|
||||
this[kState].controller instanceof ReadableByteStreamController,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1745,7 +1747,7 @@ function setupReadableStreamBYOBReader(reader, stream) {
|
||||
controller,
|
||||
} = stream[kState];
|
||||
if (!isReadableByteStreamController(controller))
|
||||
throw new ERR_INVALID_ARG_VALUE('reader', reader, 'must be a byte stream');
|
||||
throw new ERR_INVALID_ARG_VALUE('stream', stream, 'must be a byte stream');
|
||||
readableStreamReaderGenericInitialize(reader, stream);
|
||||
reader[kState].readIntoRequests = [];
|
||||
}
|
||||
|
||||
@@ -1410,10 +1410,12 @@ class Source {
|
||||
|
||||
assert.strictEqual(
|
||||
inspect(readable),
|
||||
'ReadableStream { locked: false, state: \'readable\' }');
|
||||
'ReadableStream { locked: false, state: \'readable\', ' +
|
||||
'supportsBYOB: false }');
|
||||
assert.strictEqual(
|
||||
inspect(readable, { depth: null }),
|
||||
'ReadableStream { locked: false, state: \'readable\' }');
|
||||
'ReadableStream { locked: false, state: \'readable\', ' +
|
||||
'supportsBYOB: false }');
|
||||
assert.strictEqual(
|
||||
inspect(readable, { depth: 0 }),
|
||||
'ReadableStream [Object]');
|
||||
|
||||
Reference in new issue
Block a user