diff --git a/AUTHORS b/AUTHORS index a5c813e4..dffd6ed2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,7 +6,7 @@ Mark Wubben Duncan Beevers Soutaro Matsumoto Rogier Schouten -Benjamin Gruenbaum +Benjamin Gruenbaum Karl O'Keeffe Clark Tomlinson Josh Goldberg diff --git a/History.md b/History.md index b2576441..2879fe0a 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,9 @@ +v2.1.1 / 2017-07-19 +================== + + * support passing parameters in nextTick (fixes #122) + v2.1.0 / 2017-07-18 ================== diff --git a/lolex.js b/lolex.js index 97e8a1d9..d6122285 100644 --- a/lolex.js +++ b/lolex.js @@ -182,7 +182,7 @@ function runJobs(clock) { } for (var i = 0; i < clock.jobs.length; i++) { var job = clock.jobs[i]; - job.func.apply(null, job.func.args); + job.func.apply(null, job.args); } clock.jobs = []; } @@ -302,8 +302,6 @@ function lastTimer(clock) { } function callTimer(clock, timer) { - var exception; - if (typeof timer.interval === "number") { clock.timers[timer.id].callAt += timer.interval; } else { @@ -483,7 +481,7 @@ function createClock(now, loopLimit) { clock.nextTick = function nextTick(func) { return enqueueJob(clock, { func: func, - args: Array.prototype.slice.call(1) + args: Array.prototype.slice.call(arguments, 1) }); }; clock.setInterval = function setInterval(func, timeout) {