Skip to content

Commit 2776816

Browse files
tniessenMylesBorins
authored andcommitted
test: use arrow functions instead of bind
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]>
1 parent c917cd6 commit 2776816

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎test/parallel/test-stream-push-strings.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ class MyStream extends Readable{
3636
case0:
3737
returnthis.push(null);
3838
case1:
39-
returnsetTimeout(function(){
39+
returnsetTimeout(()=>{
4040
this.push('last chunk');
41-
}.bind(this),100);
41+
},100);
4242
case2:
4343
returnthis.push('second to last chunk');
4444
case3:
45-
returnprocess.nextTick(function(){
45+
returnprocess.nextTick(()=>{
4646
this.push('first chunk');
47-
}.bind(this));
47+
});
4848
default:
4949
thrownewError('?');
5050
}

‎test/parallel/test-stream2-transform.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@ const Transform = require('_stream_transform');
211211
if(!chunk)
212212
chunk='';
213213
consts=chunk.toString();
214-
setTimeout(function(){
214+
setTimeout(()=>{
215215
this.state+=s.charAt(0);
216216
if(this.state.length===3){
217217
pt.push(Buffer.from(this.state));
218218
this.state='';
219219
}
220220
cb();
221-
}.bind(this),10);
221+
},10);
222222
};
223223

224224
pt._flush=function(cb){

0 commit comments

Comments
(0)