0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-30 10:20:52 -05:00

added check for window in Common.now

This commit is contained in:
liabru 2019-09-14 18:57:00 +01:00
parent f9ea7995bf
commit 9ef9d020c4

View file

@ -257,7 +257,7 @@ module.exports = Common;
* @return {number} the current timestamp * @return {number} the current timestamp
*/ */
Common.now = function() { Common.now = function() {
if (window.performance) { if (typeof window !== 'undefined' && window.performance) {
if (window.performance.now) { if (window.performance.now) {
return window.performance.now(); return window.performance.now();
} else if (window.performance.webkitNow) { } else if (window.performance.webkitNow) {