From 2b04ba1c86677203ad286c9be4d0bc04bf737367 Mon Sep 17 00:00:00 2001 From: Tim Oxley Date: Wed, 20 Aug 2014 07:49:53 +0800 Subject: [PATCH] Ensure integer argument to setTimeout. Related to https://github.com/joyent/node/pull/8073 Reported in https://github.com/nodeschool/discussions/issues/486 --- package.json | 2 +- problems/async_loops/setup.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 668a171..3f7c3d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "functional-javascript-workshop", - "version": "0.0.25", + "version": "0.0.26", "description": "The basics of functional programming in JavaScript. No libraries required.", "main": "index.js", "bin": { diff --git a/problems/async_loops/setup.js b/problems/async_loops/setup.js index dfbb107..b1bee62 100644 --- a/problems/async_loops/setup.js +++ b/problems/async_loops/setup.js @@ -27,7 +27,7 @@ module.exports = input(new Array(randomInt(10, 20)) var match = users.filter(function(user) {return user.id === id}) if (match.length) fn(match[0]) else fn(null) - }, Math.random() * 1000) + }, Math.floor(Math.random() * 1000)) } var done = function(submittedUsers) { clearTimeout(tooLong)