-
-
Notifications
You must be signed in to change notification settings - Fork 483
Implement Performance.now() and Performance.timeOrigin #4551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Test262 conformance changes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4551 +/- ##
===========================================
+ Coverage 47.24% 57.35% +10.11%
===========================================
Files 476 505 +29
Lines 46892 57964 +11072
===========================================
+ Hits 22154 33248 +11094
+ Misses 24738 24716 -22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9da3354 to
ebc1e14
Compare
Adds implementation of the W3C High Resolution Time API's performance.now() method and performance.timeOrigin getter property. Spec: https://w3c.github.io/hr-time/
ebc1e14 to
cb87a90
Compare
|
Ideally this should inherit from |
| time_origin: JsInstant, | ||
| } | ||
|
|
||
| impl Performance { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason you don't use the boa_class proc macro here? It would significantly reduce the code.
@HalidOdat I was starting work on class inheritance with that specifically in mind, but hit a road block and inheritance in Rust currently is broken. Do you have pointers to help? |
|
Oh didn't know you where working on that... the way I implemented it was on the Since we can attach custom host fields on the realm, I was thinking of adding an |
|
Having the inherit being an attribute on the class is more natural and closer to what JavaScript really does. Here's my PR: https://github.com/boa-dev/boa/pull/4431/changes#diff-37970e7d817d4316a093bb967d74ff7e26d9c6c01d93f5a79d3d195ba9f6155bR389 Also this allows for JS classes to inherit Rust classes which inherit JS classes, etc. |
|
I think the main blocker is that Rust's JsObject prototype stuff is broken and doesn't work. I could get it to work for static methods but not instance, for some reason. We also need to figure out a way to call |
Adds implementation of the W3C High Resolution Time API's
performance.now()method andperformance.timeOrigingetter property.Some benchmarks use this if available, which hopefully will remove the very big fluctuations in performance measurement.