-
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
test: use arrow function instead of bind #17202
Conversation
test/parallel/test-https-truncate.js
Outdated
@@ -67,6 +67,6 @@ const test = common.mustCall(function(res) { | |||
res.on('data', function(chunk) { | |||
bytes += chunk.length; | |||
this.pause(); | |||
setTimeout(this.resume.bind(this), 1); | |||
setTimeout(() => this.resume(1)); |
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.
1
should be the second argument of setTimeout()
.
CI: https://ci.nodejs.org/job/node-test-pull-request/11600/ @lpinca Issue addressed. |
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 if CI is clean
test/parallel/test-https-truncate.js
Outdated
@@ -67,6 +67,6 @@ const test = common.mustCall(function(res) { | |||
res.on('data', function(chunk) { | |||
bytes += chunk.length; | |||
this.pause(); | |||
setTimeout(this.resume.bind(this), 1); | |||
setTimeout(() => this.resume(), 1); |
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: Can you please wrap this.resume()
in {
and }
since there's no need for the function to return a value?
Using an arrow function here eliminates the need to call `bind()`.
@Trott nit addressed and CI looks good (1 unrelated failure, and a couple of known flakey tests). |
Landed in 571ecd1 |
Using an arrow function here eliminates the need to call `bind()`. PR-URL: #17202 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Using an arrow function here eliminates the need to call `bind()`. PR-URL: #17202 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Using an arrow function here eliminates the need to call `bind()`. PR-URL: #17202 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Using an arrow function here eliminates the need to call `bind()`. PR-URL: #17202 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Using an arrow function here eliminates the need to call `bind()`. PR-URL: #17202 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Using an arrow function here eliminates the need to call `bind()`. PR-URL: #17202 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Using an arrow function here eliminates the need to call
bind()
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test