Skip to content

feat: add explicit declaration of fd with null val - #40704

Closed
Gena888 wants to merge 1 commit into
nodejs:masterfrom
Gena888:patch-1
Closed

feat: add explicit declaration of fd with null val#40704
Gena888 wants to merge 1 commit into
nodejs:masterfrom
Gena888:patch-1

Conversation

@Gena888

Copy link
Copy Markdown
Contributor

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.

Screenshot 2021-11-02 at 21 53 58

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.
@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem. labels Nov 2, 2021
@tniessen
tniessen requested a review from ronagNovember 3, 2021 13:13
@tniessen

Copy link
Copy Markdown
Member

Thank you @Gena888!

To add to the screenshot above, the relevant reference is

node/doc/api/stream.md

Lines 2908 to 2912 in 2e2a6fe

constructor(filename) {
super();
this.filename= filename;
this.fd=null;
}

@tniessen

Copy link
Copy Markdown
Member

cc @nodejs/streams

Comment threaddoc/api/stream.md
constructor(filename) {
super();
this.filename = filename;
this.fd = null;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that a file descriptor is a number, using -1 might seems a better default.

@mcollina

Copy link
Copy Markdown
Member

Could you add a test?

@Gena888

Gena888 commented Nov 9, 2021

Copy link
Copy Markdown
ContributorAuthor

Could you add a test?

How can i write test for code example?)
Is it necessary ?

@mcollina

Copy link
Copy Markdown
Member

Ah I missed it, sorry.

@Gena888

Copy link
Copy Markdown
ContributorAuthor

Ah I missed it, sorry.

Any time :)

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

mcollina pushed a commit that referenced this pull request Dec 4, 2021
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: #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>
@mcollina

Copy link
Copy Markdown
Member

Landed in 069d2bd"

@mcollinamcollina closed this Dec 4, 2021
danielleadams pushed a commit that referenced this pull request Dec 14, 2021
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: #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>
danielleadams pushed a commit that referenced this pull request Jan 31, 2022
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: #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>
danielleadams pushed a commit that referenced this pull request Jan 31, 2022
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: #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>
danielleadams pushed a commit that referenced this pull request Feb 1, 2022
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: #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>
@danielleadamsdanielleadams mentioned this pull request Feb 1, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to the documentations.streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@Gena888@tniessen@mcollina@jasnell@lpinca@JungMinu@nodejs-github-bot