Skip to content

Commit

Permalink
test: use arrow function instead of bind
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lance committed Nov 22, 2017
1 parent d7b0c23 commit 571ecd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-https-truncate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

4 comments on commit 571ecd1

@jasnell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lance ... this is failing make lint on master

$ make lint
Running JS linter...

/home/james/node/main/test/parallel/test-https-truncate.js
  70:37  error  Missing semicolon  semi

βœ– 1 problem (1 error, 0 warnings)
  1 error, 0 warnings potentially fixable with the `--fix` option.

@jasnell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix: #17251

@lance
Copy link
Member Author

@lance lance commented on 571ecd1 Nov 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasnell that is super embarrassing. Very sorry about that.

@jasnell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries at all :-) ... I've done it more times than I care to admit!

Please sign in to comment.