Skip to content

Polyfill performance.now on global object#325

Open
brianchirls wants to merge 1 commit intoschteppe:masterfrom
brianchirls:performance-undefined
Open

Polyfill performance.now on global object#325
brianchirls wants to merge 1 commit intoschteppe:masterfrom
brianchirls:performance-undefined

Conversation

@brianchirls
Copy link
Copy Markdown

If cannon.js is included in a script that runs in strict mode, the polyfill of performance will throw an error because it's undeclared. You can see this by adding "use strict" to World.js or the built script and running the web workers example in Mobile Safari (iOS only supports performance in the main thread, not in a worker) or running the unit test (node doesn't support performance at all).

In browsers, the polyfill needs to be set on self in either worker or the main thread. In node, it needs to be set on global.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant