Skip to content

Commit

Permalink
test: use arrow functions instead of bind
Browse files Browse the repository at this point in the history
PR-URL: #17070
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
  • Loading branch information
tniessen authored and MylesBorins committed Dec 19, 2017
1 parent ccdf4b2 commit fe21886
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-stream-push-strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class MyStream extends Readable {
case 0:
return this.push(null);
case 1:
return setTimeout(function() {
return setTimeout(() => {
this.push('last chunk');
}.bind(this), 100);
}, 100);
case 2:
return this.push('second to last chunk');
case 3:
return process.nextTick(function() {
return process.nextTick(() => {
this.push('first chunk');
}.bind(this));
});
default:
throw new Error('?');
}
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-stream2-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ const Transform = require('_stream_transform');
if (!chunk)
chunk = '';
const s = chunk.toString();
setTimeout(function() {
setTimeout(() => {
this.state += s.charAt(0);
if (this.state.length === 3) {
pt.push(Buffer.from(this.state));
this.state = '';
}
cb();
}.bind(this), 10);
}, 10);
};

pt._flush = function(cb) {
Expand Down

0 comments on commit fe21886

Please sign in to comment.