Skip to content
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

ServerResponse doesn't inherit from stream.Writable as documented #6046

Closed
ghost opened this issue Apr 4, 2016 · 2 comments
Closed

ServerResponse doesn't inherit from stream.Writable as documented #6046

ghost opened this issue Apr 4, 2016 · 2 comments
Labels
doc Issues and PRs related to the documentations. good first issue Issues that are suitable for first-time contributors. http Issues or PRs related to the http subsystem. stream Issues and PRs related to the stream subsystem.

Comments

@ghost
Copy link

ghost commented Apr 4, 2016

  • Version: 0.10.36
  • Platform: Mac OS X
  • Subsystem: http

While it's possible to say incomingMessage instanceof stream.Readable, it's not possible to say serverResponse instanceof stream.Writable, where incomingMessage is an instance of IncomingMessage and serverResponse is an instance of ServerResponse.

The documentation claims:

Class: http.ServerResponse#
...
The response implements the Writable Stream interface. 

This is not accurate, since it just inherits from Stream, not Stream.Writable.

@mscdex mscdex added http Issues or PRs related to the http subsystem. doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem. labels Apr 5, 2016
@jasnell
Copy link
Member

jasnell commented Apr 5, 2016

implementing the interface is a bit different than inheriting from. The documentation could likely be a bit clearer on this point.

@Fishrock123
Copy link
Contributor

The response implements the Writable Stream interface (but does not inherit from it).

@Fishrock123 Fishrock123 added the good first issue Issues that are suitable for first-time contributors. label Apr 5, 2016
@jasnell jasnell closed this as completed in a45ab97 May 1, 2016
MylesBorins pushed a commit that referenced this issue May 3, 2016
Since http.serverResponse does not inherit from Stream.writable
it does not pass the test `serverResponse instanceof stream.Writable`.
This commit clarifies that serverResponse does not inherit from
stream.Writable and therefore should not be expected to pass the above
test

Fixes: #6046
PR-URL: #6072
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Robert Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Fishrock123 pushed a commit that referenced this issue May 4, 2016
Since http.serverResponse does not inherit from Stream.writable
it does not pass the test `serverResponse instanceof stream.Writable`.
This commit clarifies that serverResponse does not inherit from
stream.Writable and therefore should not be expected to pass the above
test

Fixes: #6046
PR-URL: #6072
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Robert Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
joelostrowski pushed a commit to joelostrowski/node that referenced this issue May 4, 2016
Since http.serverResponse does not inherit from Stream.writable
it does not pass the test `serverResponse instanceof stream.Writable`.
This commit clarifies that serverResponse does not inherit from
stream.Writable and therefore should not be expected to pass the above
test

Fixes: nodejs#6046
PR-URL: nodejs#6072
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Robert Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this issue May 6, 2016
Since http.serverResponse does not inherit from Stream.writable
it does not pass the test `serverResponse instanceof stream.Writable`.
This commit clarifies that serverResponse does not inherit from
stream.Writable and therefore should not be expected to pass the above
test

Fixes: #6046
PR-URL: #6072
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Robert Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this issue May 18, 2016
Since http.serverResponse does not inherit from Stream.writable
it does not pass the test `serverResponse instanceof stream.Writable`.
This commit clarifies that serverResponse does not inherit from
stream.Writable and therefore should not be expected to pass the above
test

Fixes: #6046
PR-URL: #6072
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Robert Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. good first issue Issues that are suitable for first-time contributors. http Issues or PRs related to the http subsystem. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants