Comparing version 2.6.0 to 2.7.0
v2.7.0 / 2018-05-25 | ||
================== | ||
* reset clock to start | ||
* check Performance exists before touching it | ||
v2.6.0 / 2018-05-16 | ||
@@ -7,3 +13,3 @@ ================== | ||
* Access Date on `_global` (#178) | ||
v2.5.0 / 2018-05-13 | ||
@@ -10,0 +16,0 @@ ================== |
28
lolex.js
@@ -1,2 +0,2 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.lolex = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.lolex = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
(function (global){ | ||
@@ -37,2 +37,3 @@ "use strict"; | ||
var performancePresent = (_global.performance && typeof _global.performance.now === "function"); | ||
var performanceConstructorExists = (_global.Performance && typeof _global.Performance === "function"); | ||
var requestAnimationFramePresent = ( | ||
@@ -371,3 +372,3 @@ _global.requestAnimationFrame && typeof _global.requestAnimationFrame === "function" | ||
if (!clock.timers) { | ||
clock.timers = []; | ||
clock.timers = {}; | ||
} | ||
@@ -730,3 +731,3 @@ | ||
clock.jobs = []; | ||
clock.now = 0; | ||
clock.now = getEpoch(start); | ||
}; | ||
@@ -756,12 +757,15 @@ | ||
var proto = _global.Performance.prototype; | ||
Object | ||
.getOwnPropertyNames(_global.Performance.prototype) | ||
.forEach(function (name) { | ||
if (Object.getOwnPropertyDescriptor(proto, name).writable) { | ||
clock.performance[name] = proto[name]; | ||
} | ||
}); | ||
if (performanceConstructorExists) { | ||
var proto = _global.Performance.prototype; | ||
Object | ||
.getOwnPropertyNames(proto) | ||
.forEach(function (name) { | ||
if (Object.getOwnPropertyDescriptor(proto, name).writable) { | ||
clock.performance[name] = proto[name]; | ||
} | ||
}); | ||
} | ||
clock.performance.now = function lolexNow() { | ||
@@ -868,2 +872,2 @@ return clock.hrNow; | ||
},{}]},{},[1])(1) | ||
}); | ||
}); |
{ | ||
"name": "lolex", | ||
"description": "Fake JavaScript timers", | ||
"version": "2.6.0", | ||
"version": "2.7.0", | ||
"homepage": "http://github.com/sinonjs/lolex", | ||
@@ -6,0 +6,0 @@ "author": "Christian Johansen", |
@@ -230,3 +230,5 @@ # Lolex [![Build Status](https://travis-ci.org/sinonjs/lolex.svg?branch=master)](https://travis-ci.org/sinonjs/lolex) | ||
Removes all timers and ticks without firing them, and sets `now` to `0`. Useful to reset the state of the clock without having to `uninstall` and `install` it. | ||
Removes all timers and ticks without firing them, and sets `now` to `config.now` | ||
that was provided to `lolex.install` or to `0` if `config.now` was not provided. | ||
Useful to reset the state of the clock without having to `uninstall` and `install` it. | ||
@@ -233,0 +235,0 @@ ### `clock.runAll()` |
@@ -35,2 +35,3 @@ "use strict"; | ||
var performancePresent = (_global.performance && typeof _global.performance.now === "function"); | ||
var performanceConstructorExists = (_global.Performance && typeof _global.Performance === "function"); | ||
var requestAnimationFramePresent = ( | ||
@@ -369,3 +370,3 @@ _global.requestAnimationFrame && typeof _global.requestAnimationFrame === "function" | ||
if (!clock.timers) { | ||
clock.timers = []; | ||
clock.timers = {}; | ||
} | ||
@@ -728,3 +729,3 @@ | ||
clock.jobs = []; | ||
clock.now = 0; | ||
clock.now = getEpoch(start); | ||
}; | ||
@@ -754,12 +755,15 @@ | ||
var proto = _global.Performance.prototype; | ||
Object | ||
.getOwnPropertyNames(_global.Performance.prototype) | ||
.forEach(function (name) { | ||
if (Object.getOwnPropertyDescriptor(proto, name).writable) { | ||
clock.performance[name] = proto[name]; | ||
} | ||
}); | ||
if (performanceConstructorExists) { | ||
var proto = _global.Performance.prototype; | ||
Object | ||
.getOwnPropertyNames(proto) | ||
.forEach(function (name) { | ||
if (Object.getOwnPropertyDescriptor(proto, name).writable) { | ||
clock.performance[name] = proto[name]; | ||
} | ||
}); | ||
} | ||
clock.performance.now = function lolexNow() { | ||
@@ -766,0 +770,0 @@ return clock.hrNow; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
79843
1465
316
1