From 2776816945580a6da2896edd7beb5398253c22f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Thu, 16 Nov 2017 13:33:53 +0100 Subject: [PATCH] test: use arrow functions instead of bind MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/17070 Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Lance Ball Reviewed-By: Gireesh Punathil Reviewed-By: Khaidi Chu --- test/parallel/test-stream-push-strings.js | 8 ++++---- test/parallel/test-stream2-transform.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-stream-push-strings.js b/test/parallel/test-stream-push-strings.js index c2383f3de1de4f..d582c8add005a5 100644 --- a/test/parallel/test-stream-push-strings.js +++ b/test/parallel/test-stream-push-strings.js @@ -36,15 +36,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('?'); } diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index 0f12476f506a93..38f6bc64db35a7 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -211,14 +211,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) {