Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

P0: after honest pointers (#12529), native handles in arithmetic/ToNumeric are treated as non-objects (1/new Headers() → typeof object)

Open
#12,540 0 comments 0 reactions 0 assignees View on GitHub

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PerryTS/perry

All issues in PerryTS/perry

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.