mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
stream: fix isErrored/isWritable for WritableStreams
PR-URL: https://github.com/nodejs/node/pull/60905 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
@@ -76,6 +76,8 @@ const {
|
||||
|
||||
const {
|
||||
kIsClosedPromise,
|
||||
kIsErrored,
|
||||
kIsWritable,
|
||||
kControllerErrorFunction,
|
||||
} = require('internal/streams/utils');
|
||||
|
||||
@@ -183,6 +185,14 @@ class WritableStream {
|
||||
size);
|
||||
}
|
||||
|
||||
get [kIsErrored]() {
|
||||
return this[kState].state === 'errored';
|
||||
}
|
||||
|
||||
get [kIsWritable]() {
|
||||
return this[kState].state === 'writable';
|
||||
}
|
||||
|
||||
/**
|
||||
* @readonly
|
||||
* @type {boolean}
|
||||
|
||||
Reference in New Issue
Block a user