From 39a561b3bc63c7639ae6b6c5514669339c63201a Mon Sep 17 00:00:00 2001 From: Lakshmi Shanmugam Date: Sat, 17 Nov 2018 17:32:09 +0530 Subject: [PATCH] test: change callback function to arrow function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/24421 Reviewed-By: Ouyang Yadong Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat --- test/parallel/test-stream-unshift-empty-chunk.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-stream-unshift-empty-chunk.js b/test/parallel/test-stream-unshift-empty-chunk.js index 9c2c12a41a3958..0f0a13722cab14 100644 --- a/test/parallel/test-stream-unshift-empty-chunk.js +++ b/test/parallel/test-stream-unshift-empty-chunk.js @@ -32,14 +32,14 @@ let nChunks = 10; const chunk = Buffer.alloc(10, 'x'); r._read = function(n) { - setImmediate(function() { + setImmediate(() => { r.push(--nChunks === 0 ? null : chunk); }); }; let readAll = false; const seen = []; -r.on('readable', function() { +r.on('readable', () => { let chunk; while (chunk = r.read()) { seen.push(chunk.toString()); @@ -74,7 +74,7 @@ const expect = 'xxxxxxxxxx', 'yyyyy' ]; -r.on('end', function() { +r.on('end', () => { assert.deepStrictEqual(seen, expect); console.log('ok'); });