mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -05:00
added check for window in Common.now
This commit is contained in:
parent
f9ea7995bf
commit
9ef9d020c4
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue