0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-24 13:29:01 -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
*/
Common.now = function() {
if (window.performance) {
if (typeof window !== 'undefined' && window.performance) {
if (window.performance.now) {
return window.performance.now();
} else if (window.performance.webkitNow) {