-
Notifications
You must be signed in to change notification settings - Fork 30k
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
doc: fix variable scoping bug in Stream HTTP server example code #8124
Conversation
@@ -122,23 +122,22 @@ const server = http.createServer( (req, res) => { | |||
req.setEncoding('utf8'); | |||
|
|||
// Readable streams emit 'data' events once a listener is added | |||
req.on('data', (chunk) => { | |||
req.on('data', chunk => { |
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.
nit: our preferred code style in core is to require parens around arguments in arrow functions.
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.
removed (n)it
LGTM with a nit |
Const is block scoped.
6b07664
to
061880f
Compare
LGTM |
Const is block scoped. PR-URL: #8124 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Myles Borins <[email protected]>
Landed in 66d697c! thank you @lazlojuly ! |
Const is block scoped. PR-URL: #8124 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Myles Borins <[email protected]>
Const is block scoped. PR-URL: #8124 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Myles Borins <[email protected]>
Const is block scoped. PR-URL: #8124 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Myles Borins <[email protected]>
Const is block scoped. PR-URL: #8124 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Myles Borins <[email protected]>
Const is block scoped. PR-URL: #8124 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Myles Borins <[email protected]>
Checklist
Description of change
Const is block-scoped.
Stream HTTP server example code is broken since
const
was introduced inside a try block.