From c16c79bb9c50bb02912e93092c369433cb93167f Mon Sep 17 00:00:00 2001 From: Brian Chirls Date: Sun, 1 Jan 2017 19:20:36 -0500 Subject: [PATCH] Polyfill performance.now on global object --- src/world/World.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/world/World.js b/src/world/World.js index 2a0d4a21e..eab99099c 100644 --- a/src/world/World.js +++ b/src/world/World.js @@ -488,7 +488,12 @@ World.prototype.addContactMaterial = function(cmat) { // performance.now() if(typeof performance === 'undefined'){ - performance = {}; + if (typeof global !== undefined) { + global.performance = {}; + } + if (typeof self !== 'undefined') { + self.performance = {}; + } } if(!performance.now){ var nowOffset = Date.now();