Skip to content

streams: update .readable/.writable to false

These properties were initially used to determine stream status back in node v0.8 and earlier. Since streams2 however, these properties were always true, which can be misleading for example if you are trying to immediately determine whether a Writable stream is still writable or not (to avoid a "write after end" exception).

This commit avoids having to dig into internal stream state to know whether you can still read/push() with a Readable stream and whether you can still write()/end() a Writable stream at any given time. It also makes the behavior of .readable/.writable consistent with other core modules that use properties with the same names (e.g. net.Socket).

Merge request reports

Loading