Skip to content

Conversation

TooTallNate
Copy link
Contributor

I was already including a performance property, but switching to quickjs-ng throws an error when trying to re-define that prop. Make it configurable to match browser behavior:

Object.getOwnPropertyDescriptor(globalThis, 'performance').configurable
// true

@saghul
Copy link
Contributor

saghul commented Dec 22, 2023

Is that what browsers do? I thought it would be read only since that's how it's specified: https://w3c.github.io/hr-time/#the-performance-attribute

@TooTallNate
Copy link
Contributor Author

The script in the OP is true for at least Chrome / Firefox / Safari.

@bnoordhuis
Copy link
Contributor

Read-only but [Replaceable], i.e., configurable. FWIW, it's both configurable and enumerable in node too.

@saghul saghul merged commit f94fbe2 into quickjs-ng:master Dec 22, 2023
@TooTallNate TooTallNate deleted the performance-configurable branch December 22, 2023 22:10
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.

3 participants