You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hono fixture: r1 regressed from 200 to 404 after v0.5.722 dynamic-dispatch override probe #632
After v0.5.722's dynamic-dispatch override probe (#620 followup), the hono-basic fixture's first request regressed: previously r1.status=200 / r1.body={"hello":"world"}; now r1.status=404 / r1.body=not found. r2 and r3 also return 404. New [PERRY WARN] js_box_get: invalid box pointer 0x0 warnings appear on each request.
Repro
tests/release/packages/hono-basic/entry.ts from #603 — see issue body. Pre-v0.5.722 produced r1=200 + silent exit on r2 (Fatal error from #628). Post-v0.5.722 dispatches all 3 calls but matches none.
v0.5.722 (after dynamic-dispatch override probe): all 3 calls run, all return 404.
The dynamic-dispatch override fix is correct in isolation: test_628_dyn.ts (interface-typed receiver with this.method = X override) now matches Node byte-for-byte. Other dispatch tests (test_628.ts, test_603_smartrouter_mock.ts, test_603_sr_loop.ts, the cross-module SmartRouter mock at /tmp/repro_xmod) all match Node.
But hono regressed. The js_box_get: invalid box pointer 0x0 warnings hint at a closure-capture interaction the probe may have broken — perhaps the probe call's IR ordering disturbs an SSA value's dominance, or the new blocks cause a phi-edge mismatch in some call path.
Suggested investigation
Compare LLVM IR for app.get("/", handler) registration before and after v0.5.722 — does the handler get stored differently?
Check whether the route-registration this.router.add(...) call from app.get lands in the dynamic-dispatch path. If so, my override probe runs there too. The probe is supposed to be a no-op when the receiver has no override, but may be perturbing something.
Trace whether matchResult[0] is empty (route not registered) vs non-empty (route registered but dispatch fails).
Acceptance
tests/release/packages/hono-basic/out produces the expected:
r1.status=200
r1.body={"hello":"world"}
r2.status=200
r2.body={"id":"42","name":"User 42"}
r3.status=404
r3.body=not found
Closed in v0.5.726. Bisected to a missing IMPLICIT_THIS bind in v0.5.722's override path (and v0.5.716's static fast-path #620 fix). Both paths called js_native_call_value(stored_method, args) without setting IMPLICIT_THIS to the receiver — fine for arrow / .bind()-bound methods that capture their own this, but broken for regular stored methods like hono's class RegExpRouter { match = match; } where the imported standalone match body reads this.buildAllMatchers(). Without the bind, the body saw stale IMPLICIT_THIS (or undefined) and the route lookup silently failed.
Fix: save/set/restore IMPLICIT_THIS around the js_native_call_value call in both paths. Mirrors the pre-existing closure-call fallthrough at lower_call.rs:2607 (issue #519).
Hono fixture r1 flips 404 → 200 matching expected. r3 (/missing) correctly 404 with "not found". r2 (/users/:id param route) still returns 404 — separate path-regex/param-extraction issue not blocked on this fix.
Activity
proggeramlug commentedon May 9, 2026
Closed in v0.5.726. Bisected to a missing IMPLICIT_THIS bind in v0.5.722's override path (and v0.5.716's static fast-path #620 fix). Both paths called
js_native_call_value(stored_method, args)without settingIMPLICIT_THISto the receiver — fine for arrow /.bind()-bound methods that capture their ownthis, but broken for regular stored methods like hono'sclass RegExpRouter { match = match; }where the imported standalonematchbody readsthis.buildAllMatchers(). Without the bind, the body saw staleIMPLICIT_THIS(or undefined) and the route lookup silently failed.Fix: save/set/restore
IMPLICIT_THISaround thejs_native_call_valuecall in both paths. Mirrors the pre-existing closure-call fallthrough atlower_call.rs:2607(issue #519).Hono fixture r1 flips 404 → 200 matching expected. r3 (
/missing) correctly 404 with "not found". r2 (/users/:idparam route) still returns 404 — separate path-regex/param-extraction issue not blocked on this fix.fix: closes #632 — bind IMPLICIT_THIS around override-path js_native_…