Skip to content

Commit

Permalink
Prepare for new release
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 committed Jul 25, 2017
1 parent 946ed51 commit e756f3b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Maximilian Antoni <mail@maxantoni.de>
Mark Wubben <mark@novemberborn.net>
Duncan Beevers <duncan@dweebd.com>
Soutaro Matsumoto <matsumoto@soutaro.com>
Benjamin Gruenbaum <inglor@gmail.com>
Rogier Schouten <github@workingcode.ninja>
Benjamin Gruenbaum <benji@peer5.com>
Karl O'Keeffe <karl@geckoboard.com>
Elad Nachmias <theman@elad.im>
Clark Tomlinson <fallen013@gmail.com>
Josh Goldberg <joshuakgoldberg@outlook.com>
Andy Edwards <jedwards@fastmail.com>
Curtis M. Humphrey, Ph.D <curtis@createdwithflair.com>
Elad Nachmias <theman@elad.im>
Kyle Fleming <kyle@kylefleming.net>
Mark Banner <standard8@mozilla.com>
Nando <fdanko@ekumenlabs.com>
Expand Down
6 changes: 6 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

v2.1.2 / 2017-07-25
==================

* - does not fake process.nextTick by default - added .idea folder to .gitignore - fixed documentation - added clock teardowns in tests
* overflowing the timer correctly (issue #67)

v2.1.1 / 2017-07-19
==================

Expand Down
12 changes: 11 additions & 1 deletion lolex.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

var userAgent = global.navigator && global.navigator.userAgent;
var isRunningInIE = userAgent && userAgent.indexOf("MSIE ") > -1;
var maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint

// Make properties writable in IE, as per
// http://www.adequatelygood.com/Replacing-setTimeout-Globally.html
Expand Down Expand Up @@ -192,6 +193,14 @@ function addTimer(clock, timer) {
throw new Error("Callback must be provided to timer calls");
}

if (timer.hasOwnProperty("delay")) {
timer.delay = timer.delay > maxTimeout ? 1 : timer.delay;
}

if (timer.hasOwnProperty("interval")) {
timer.interval = timer.interval > maxTimeout ? 1 : timer.interval;
}

if (!clock.timers) {
clock.timers = {};
}
Expand Down Expand Up @@ -691,7 +700,8 @@ exports.install = function install(config) {
clock.methods = config.toFake || [];

if (clock.methods.length === 0) {
clock.methods = keys(timers);
// do not fake nextTick by default - GitHub#126
clock.methods = keys(timers).filter(function (key) {return key !== "nextTick";});
}

for (i = 0, l = clock.methods.length; i < l; i++) {
Expand Down

0 comments on commit e756f3b

Please sign in to comment.