P0: after honest pointers (#12529), native handles in arithmetic/ToNumeric are treated as non-objects (1/new Headers() → typeof object)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust, typescript
- Domain
- compilers
Research direction
Start with to_numeric in crates/perry-runtime/src/value/dynamic_arith.rs, where the !jsval.is_pointer() check lets HANDLE_TAG values reach js_number_coerce, then grep is_pointer across crates/perry-runtime to list the other call sites. Reproduce with 1/new Headers() and x + 1 through any and compare with node. Done when those cases match node and every site meaning 'is an object' accepts handles, either through one shared predicate or per-site fixes.
Written by the indexing model from the issue text.
Description
Found by the numguard lane. On main since #12529: function inv(x: number){return 1/x} called through any with new Headers() prints typeof "object" (node: "number", NaN). x + 1 gives object:NaN (node: "[object Headers]1"); a - b is wrong the same way. Cause: to_numeric in crates/perry-runtime/src/value/dynamic_arith.rs tests !jsval.is_pointer(), which is false for HANDLE_TAG values, so a handle passes into js_number_coerce as is and the fdiv propagates the handle's NaN payload. This is a class of bug: every is_pointer() that semantically means "is an object / JS reference" must also accept handles (or use one canonical is_object_like predicate). Audit them all, not just this site.
- Dominant language
- Rust
- Stars
- 4.9k
- Forks
- 166
- Avg merge
- 3h 23m
- Merged PRs (30d)
- 911
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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 PerryTS/perry
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
Maintainers usually reply within 1 day
Similar issues
-
documentation P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
bug good first issue priority:high
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Konfirm-xyz/konfirm-contracts#163 ·
Maintainers usually reply within 1 day
-
area:gc-repack-output bug factory:dogfood factory:triaged priority:p3 type:bug type:ux
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
gitbutlerapp/grit#1161 · 1 comment ·
Maintainers usually reply within 1 day
-
feature performance
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
lance-format/lance#10137 ·
Maintainers usually reply within 2 days
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 85/100