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

test: use arrow function instead of bind #17202

Closed
wants to merge 1 commit into from
Closed

test: use arrow function instead of bind #17202

wants to merge 1 commit into from

Conversation

lance
Copy link
Member

@lance lance commented Nov 21, 2017

Using an arrow function here eliminates the need to call bind().

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 21, 2017
@@ -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));
Copy link
Member

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().

@mscdex mscdex added the https Issues or PRs related to the https subsystem. label Nov 21, 2017
@lance
Copy link
Member Author

lance commented Nov 21, 2017

Copy link
Member

@Trott Trott left a 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

@@ -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);
Copy link
Member

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()`.
@lance
Copy link
Member Author

lance commented Nov 22, 2017

@Trott nit addressed and CI looks good (1 unrelated failure, and a couple of known flakey tests).

@lance
Copy link
Member Author

lance commented Nov 22, 2017

Landed in 571ecd1

@lance lance closed this Nov 22, 2017
lance added a commit that referenced this pull request Nov 22, 2017
Using an arrow function here eliminates the need to call `bind()`.

PR-URL: #17202
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Using an arrow function here eliminates the need to call `bind()`.

PR-URL: #17202
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Using an arrow function here eliminates the need to call `bind()`.

PR-URL: #17202
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Dec 12, 2017
MylesBorins pushed a commit that referenced this pull request Dec 19, 2017
Using an arrow function here eliminates the need to call `bind()`.

PR-URL: #17202
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
Using an arrow function here eliminates the need to call `bind()`.

PR-URL: #17202
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
Using an arrow function here eliminates the need to call `bind()`.

PR-URL: #17202
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
@MylesBorins MylesBorins mentioned this pull request Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
https Issues or PRs related to the https subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.