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:
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
|
* @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) {
|
||||||
|
|
Loading…
Reference in a new issue