Permalink
Browse files

test: use arrow functions instead of bind

PR-URL: #17070
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
  • Loading branch information...
tniessen authored and MylesBorins committed Nov 16, 2017
1 parent ccdf4b2 commit fe2188620d816d973378f7f9679446a22307ab41
Showing with 6 additions and 6 deletions.
  1. +4 −4 test/parallel/test-stream-push-strings.js
  2. +2 −2 test/parallel/test-stream2-transform.js
@@ -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('?');
}
@@ -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) {

0 comments on commit fe21886

Please sign in to comment.