performance.now() bypasses Host and uses std::time::Instant (unsupported on wasm32-unknown-unknown)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust, wasm
- Domain
- backend, embedded-iot
Research direction
Start with core/src/builtins/global.rs:11 and follow the call to agent::monotonic_ms in core/src/builtins/agent.rs:75; then inspect the Host trait, Host::now_ms, and WebHost. Add a host-provided monotonic clock with a native default and browser implementation. Done when performance.now() uses that clock, native behavior remains available, and the wasm browser path no longer calls unsupported Instant::now().
Written by the indexing model from the issue text.
Description
performance.now(), installed by Context::install_qjs_helpers, reads std::time::Instant directly (core/src/builtins/global.rs:11 -> agent::monotonic_ms, core/src/builtins/agent.rs:75) instead of going through the Host.
Consequences:
- An embedder cannot control or fake the monotonic clock the way
Host::now_mscontrolsDate.now()(reproducible runs, tests). std::time::Instant::now()is unsupported onwasm32-unknown-unknown(std panics, and thewebprofile ispanic = "abort"), so a browser embedder that installs the qjs helpers would abort on the firstperformance.now()call. Not exercised today because the web binding does not install the helpers.
Suggestion: add a Host method for the monotonic clock (default: Instant on native) and implement it in WebHost with the browser's performance.now().
- Dominant language
- Rust
- Stars
- 61
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pocket-stack/quickjs-oxide
-
Difficulty 4/5 3-5 days Newbie friendliness 44/100
pocket-stack/quickjs-oxide#192 · 3 comments ·
-
Two public SystemHost types: the core one is always UTC, the host crate's uses the system time zoneOpenenhancement
Difficulty 3/5 1-2 days Newbie friendliness 52/100
pocket-stack/quickjs-oxide#164 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 56/100
pocket-stack/quickjs-oxide#163 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
pocket-stack/quickjs-oxide#158 · 1 comment ·
-
Execution slow paths: inline-cache misses (Gameboy), typed-array access (zlib), array stores (Sieve)Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
pocket-stack/quickjs-oxide#157 ·
All issues in pocket-stack/quickjs-oxide
Similar issues
-
area:web kind:bug priority:p2 ready
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 84/100
sims1253/r-typeshed#140 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
storytold/craft-libs#2867 ·
Maintainers usually reply within 1 day
-
help wanted needs investigation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 62/100