-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream: avoid setting writable state #31805
Conversation
@Trott: Problems getting CI to pass:
Any advice? |
e6a54b6
to
7b70470
Compare
A remainder from a previous refactoring. Refs: nodejs#31197
7b70470
to
8dd4e55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs unit tests
e9a79e3
to
a712f4e
Compare
a712f4e
to
db24c25
Compare
I don't understand the reasoning behind this change, or what effect it would have on our APIs. Can you please elaborate? Note that the above link is a 404 |
It doesn't change the API at all. We did a refactoring in #31197 to make This PR doesn't change any API behavior. However, it fixes an unnecessary write to |
can you add a test for that? |
|
I’m lost. You said it would save a call to write() and I cannot see how. |
@@ -687,7 +687,6 @@ function endWritable(stream, state, cb) { | |||
onFinished(stream, state, cb); | |||
} | |||
state.ended = true; | |||
stream.writable = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcollina: The point is to remove this. It’s unnecessary (it should already be false through the computed getter) and causes the ‘writable’ property to be unnecessarily added on the state object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Landed in 85c6fcd |
A remainder from a previous refactoring.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes