-
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
http2: add constant to already destructured constants #28176
Conversation
const Readable = Stream.Readable; | ||
const binding = internalBinding('http2'); | ||
const constants = binding.constants; | ||
const { Readable } = Stream; |
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.
const { Readable } = Stream; | |
const { Readable } = require('stream'); |
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.
thing is that Http2ServerResponse
extends from Stream
below, so we need a Stream reference as well. if we could use ES6 modules internally, I'd use a 'default', and a 'named import': import Stream, { Readable } from ...
.
@@ -4,9 +4,8 @@ const { Object, ObjectPrototype, Reflect } = primordials; | |||
|
|||
const assert = require('internal/assert'); | |||
const Stream = require('stream'); |
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.
const Stream = require('stream'); |
I am not a huge fan of changes like these. They do not seem to bring much benefit but I won't block this either. |
This comment has been minimized.
This comment has been minimized.
Landed in 3a9cb5c...b04de23 |
PR-URL: nodejs#28176 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: nodejs#28176 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #28176 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #28176 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
add constant to already destructured constants and while we're at it, destructure
Readable
andconstants
as well, removebinding
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes