-
-
Notifications
You must be signed in to change notification settings - Fork 414
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
setTimeout
, setInterval
and clearInterval
(and the same clearTimeout
) implementations
#4130
Conversation
…imeout`) implementations This adds non-async implementations of the `setTimeout`/`setInterval` API functions. They are by default registered in the context when registering all APIs from `boa_runtime`.
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.
Really nice implementation! I have some opinions on using SystemTime
, but aside from that everything else looks great!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4130 +/- ##
==========================================
+ Coverage 47.24% 54.68% +7.44%
==========================================
Files 476 492 +16
Lines 46892 49377 +2485
==========================================
+ Hits 22154 27002 +4848
+ Misses 24738 22375 -2363 ☔ View full report in Codecov by Sentry. |
This will add the capacity for the entire engine to mock time during tests. No impact on performance should be noticeable. Fixed boa-dev#4144
A negative duration is invalid.
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.
Looking great overall! Nice job!
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.
Looks really nice!
This adds non-async implementations of the
setTimeout
/setInterval
API functions. They are by default registered in the context when registering all APIs fromboa_runtime
.This adds a new type of jobs that implement
HostEnqueueTimeoutJob
(see https://tc39.es/ecma262/#sec-hostenqueuetimeoutjob).This requires #4141 to be merged first.