Skip to content

Commit fe21886

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 ccdf4b2 commit fe21886

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
@@ -15,15 +15,15 @@ class MyStream extends Readable{
1515
case0:
1616
returnthis.push(null);
1717
case1:
18-
returnsetTimeout(function(){
18+
returnsetTimeout(()=>{
1919
this.push('last chunk');
20-
}.bind(this),100);
20+
},100);
2121
case2:
2222
returnthis.push('second to last chunk');
2323
case3:
24-
returnprocess.nextTick(function(){
24+
returnprocess.nextTick(()=>{
2525
this.push('first chunk');
26-
}.bind(this));
26+
});
2727
default:
2828
thrownewError('?');
2929
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@ const Transform = require('_stream_transform');
190190
if(!chunk)
191191
chunk='';
192192
consts=chunk.toString();
193-
setTimeout(function(){
193+
setTimeout(()=>{
194194
this.state+=s.charAt(0);
195195
if(this.state.length===3){
196196
pt.push(Buffer.from(this.state));
197197
this.state='';
198198
}
199199
cb();
200-
}.bind(this),10);
200+
},10);
201201
};
202202

203203
pt._flush=function(cb){

0 commit comments

Comments
(0)