Skip to content

Commit

Permalink
Updated release files for 2.7.5
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 committed Sep 19, 2018
1 parent c4ee56d commit 76c212d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion AUTHORS
Expand Up @@ -2,8 +2,8 @@ Carl-Erik Kopseng <carlerik@gmail.com>
Christian Johansen <christian@cjohansen.no>
Morgan Roderick <morgan@roderick.dk>
Benjamin Gruenbaum <benji@peer5.com>
Maximilian Antoni <mail@maxantoni.de>
Simen Bekkhus <sbekkhus91@gmail.com>
Maximilian Antoni <mail@maxantoni.de>
Mark Wubben <mark@novemberborn.net>
Duncan Beevers <duncan@dweebd.com>
Soutaro Matsumoto <matsumoto@soutaro.com>
Expand All @@ -21,6 +21,7 @@ Edward Betts <edward@4angle.com>
Jamie Wong <phleet@gmail.com>
KimCoding <jeokrang@hanmail.net>
Kyle Fleming <kyle@kylefleming.net>
Louis Brunner <LouisBrunner@users.noreply.github.com>
Marc Redemske <mgred@users.noreply.github.com>
Mark Banner <standard8@mozilla.com>
Nando <fdanko@ekumenlabs.com>
Expand Down
6 changes: 6 additions & 0 deletions History.md
@@ -1,3 +1,9 @@
v2.7.5 / 2018-09-19
==================

* fix: handle floating point in hrtime (#210)
* fix: reset high resolution timer on clock.reset (#209)
* Add an error when creating a clock with no Date object (#205)

v2.7.4 / 2018-09-05
==================
Expand Down
10 changes: 8 additions & 2 deletions lolex.js
Expand Up @@ -103,7 +103,7 @@ function withGlobal(_global) {
* % operator that also works for negative numbers
*/
function fixedModulo(n, m) {
return ((n % m) + m) % m;
return Math.round(((n % m) + m) % m);
}

/**
Expand Down Expand Up @@ -514,6 +514,11 @@ function withGlobal(_global) {
start = start || 0;
loopLimit = loopLimit || 1000;

if (NativeDate === undefined) {
throw new Error("The global scope doesn't have a `Date` object"
+ " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)");
}

var clock = {
now: getEpoch(start),
hrNow: 0,
Expand Down Expand Up @@ -717,13 +722,14 @@ function withGlobal(_global) {
return clock.now;
}

return clock.tick(timer.callAt);
return clock.tick(timer.callAt - clock.now);
};

clock.reset = function reset() {
clock.timers = {};
clock.jobs = [];
clock.now = getEpoch(start);
clock.hrNow = 0;
};

clock.setSystemTime = function setSystemTime(systemTime) {
Expand Down

0 comments on commit 76c212d

Please sign in to comment.