mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: use arrow function instead of bind
Using an arrow function here eliminates the need to call `bind()`. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 file changed
+1
-1
@@ -67,6 +67,6 @@ const test = common.mustCall(function(res) {
|
|||||||
res.on('data', function(chunk) {
|
res.on('data', function(chunk) {
|
||||||
bytes += chunk.length;
|
bytes += chunk.length;
|
||||||
this.pause();
|
this.pause();
|
||||||
setTimeout(this.resume.bind(this), 1);
|
setTimeout(() => { this.resume() }, 1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user