From 0ef4f78ae0fbea01f846de5b450c2c8d43c0c168 Mon Sep 17 00:00:00 2001 From: Hiroaki KARASAWA Date: Sun, 26 Nov 2017 17:34:16 +0900 Subject: [PATCH] test: replace function with 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/17308 Reviewed-By: Joyee Cheung Reviewed-By: Vse Mozhet Byt Reviewed-By: Michaƫl Zasso Reviewed-By: Daijiro Wachi Reviewed-By: Gireesh Punathil Reviewed-By: Jon Moss Reviewed-By: James M Snell --- test/parallel/test-timers.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-timers.js b/test/parallel/test-timers.js index daabfcf29ddf19..dbbf3dc899b15a 100644 --- a/test/parallel/test-timers.js +++ b/test/parallel/test-timers.js @@ -33,12 +33,12 @@ const inputs = [ const timeouts = []; const intervals = []; -inputs.forEach(function(value, index) { - setTimeout(function() { +inputs.forEach((value, index) => { + setTimeout(() => { timeouts[index] = true; }, value); - const handle = setInterval(function() { + const handle = setInterval(() => { clearInterval(handle); // disarm timer or we'll never finish intervals[index] = true; }, value); @@ -47,9 +47,9 @@ inputs.forEach(function(value, index) { // All values in inputs array coerce to 1 ms. Therefore, they should all run // before a timer set here for 2 ms. -setTimeout(common.mustCall(function() { +setTimeout(common.mustCall(() => { // assert that all other timers have run - inputs.forEach(function(value, index) { + inputs.forEach((value, index) => { assert.strictEqual(true, timeouts[index]); assert.strictEqual(true, intervals[index]); });