File tree Expand file tree Collapse file tree 4 files changed +20
-7
lines changed
Expand file tree Collapse file tree 4 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -13026,8 +13026,12 @@ var World = /*#__PURE__*/function (_EventTarget) {
1302613026var tmpAABB1 = new AABB ( ) ;
1302713027var tmpRay$1 = new Ray ( ) ; // performance.now()
1302813028
13029- if ( typeof performance === 'undefined' ) {
13030- performance = { } ;
13029+ var performance = { } ;
13030+
13031+ if ( typeof window !== 'undefined' ) {
13032+ performance = window . performance ;
13033+ } else {
13034+ performance = require ( 'perf_hooks' ) . performance ;
1303113035}
1303213036
1303313037if ( ! performance . now ) {
Original file line number Diff line number Diff line change @@ -12194,8 +12194,12 @@ class World extends EventTarget {
1219412194const tmpAABB1 = new AABB ( ) ;
1219512195const tmpRay$1 = new Ray ( ) ; // performance.now()
1219612196
12197- if ( typeof performance === 'undefined' ) {
12198- performance = { } ;
12197+ let performance = { } ;
12198+
12199+ if ( typeof window !== 'undefined' ) {
12200+ performance = window . performance ;
12201+ } else {
12202+ performance = require ( 'perf_hooks' ) . performance ;
1219912203}
1220012204
1220112205if ( ! performance . now ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " cannon-es" ,
3- "version" : " 0.10 .0" ,
3+ "version" : " 0.11 .0" ,
44 "description" : " A lightweight 3D physics engine written in JavaScript." ,
55 "homepage" : " https://github.com/schteppe/cannon.js" ,
66 "author" : " Stefan Hedman <schteppe@gmail.com> (http://steffe.se)" ,
Original file line number Diff line number Diff line change @@ -800,9 +800,14 @@ const tmpArray1 = []
800800const tmpRay = new Ray ( )
801801
802802// performance.now()
803- if ( typeof performance === 'undefined' ) {
804- ; ( performance as any ) = { }
803+ let performance = { } as Performance
804+
805+ if ( typeof window !== 'undefined' ) {
806+ performance = window . performance
807+ } else {
808+ performance = require ( 'perf_hooks' ) . performance
805809}
810+
806811if ( ! performance . now ) {
807812 let nowOffset = Date . now ( )
808813 if ( performance . timing && performance . timing . navigationStart ) {
You can’t perform that action at this time.
0 commit comments