locutusjs / locutus

Bringing stdlibs of other programming languages to JavaScript for educational purposes
https://locutus.io
MIT License
3.72k stars 1.12k forks source link

Check if perfomance has timing property #449

Closed haedaal closed 3 years ago

haedaal commented 3 years ago

Description

https://github.com/nodejs/node/issues/28635

performance became a global variable on node 16, but it does not have timing property. and it's throwing following error.

I think this fix does not worth comments so I omitted examples and credit.

> m = require('./microtime')
[Function: microtime]
> m()
Uncaught TypeError: Cannot read properties of undefined (reading 'navigationStart')
    at microtime (.../locutus/src/php/datetime/microtime.js:17:51)
kukawski commented 3 years ago

@haedaal thank you for the fix.

meirkeller commented 2 years ago

@kukawski When are you going to release a version with this fix?

kukawski commented 2 years ago

@kvz could you please handle the release? We should probably also figure out automatic publishing.

kvz commented 2 years ago

@kvz could you please handle the release?

:+1: + locutus@2.0.16

We should probably also figure out automatic publishing.

That would be great, as time passes my bandwidth for this project seems to decrease I'm afraid.