-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
base: main
Are you sure you want to change the base?
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% 53.69% +6.44%
==========================================
Files 476 490 +14
Lines 46892 49010 +2118
==========================================
+ Hits 22154 26314 +4160
+ Misses 24738 22696 -2042 ☔ 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.
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.