mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
doc: add explicit declaration of fd with null val
In example of implementing a writable stream with extending on Writable add explicit declaration of 'fd' (file descriptor) variable with null value. It will make this example more similar to readable stream's one. And will make it easier to figure out in topic. PR-URL: https://github.com/nodejs/node/pull/40704 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
1 parent
9cfdf15da6
commit
94d09113a2
1 file changed
+1
@@ -2558,6 +2558,7 @@ class WriteStream extends Writable {
|
||||
constructor(filename) {
|
||||
super();
|
||||
this.filename = filename;
|
||||
this.fd = null;
|
||||
}
|
||||
_construct(callback) {
|
||||
fs.open(this.filename, (err, fd) => {
|
||||
|
||||
Reference in new issue
Block a user