Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make performance configurable #233

Merged
merged 1 commit into from
Dec 22, 2023

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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants