Call namespace class statics through values when no native entry matches - #12022
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughNative-module class static call lowering now checks module exports and manifest entries before emitting native dispatch. Compiler tests and runtime test files cover Node namespace statics and user-defined class statics. ChangesNamespace Class Static Calls
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The namespace static-call change is mergeable after normal checks; no concrete regression remains identified. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The change restores calls to existing exported functions while retaining unsupported-export checks. The reviewed call paths do not grant new privileges or expose capabilities beyond call forms already available. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 6 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b8eaef7 to
8713d6e
Compare
Problem:
ns.URL.canParse,ns.KeyObject.from, andns.Stream.getMaxListenerscan build an undispatched native class call and return undefined despite an existing function on the exported constructor.Cause and fix: retain native entries with either a matching class filter or a module-wide filter; otherwise use ordinary member access and call lowering. Preserve main's existing value routes, HTTP Server.call, spread behavior and the unknown-export gate. This keeps inherited events/cluster direct getMaxListeners calls at 10. Runtime static values missing on main are documented in a follow-up list of statics perry lacks for separate fixes.
Tests: seven HIR units, the focused built-in and user-module gaps, existing builtin-values/native function-method gaps, 29 module probes plus compatibility probes, and five source sabotage checks.
Results: all 14 programs match Node 26.5.1. CPU/RSS medians of five; instructions minimum of three; exact executable bytes.
Gates: fmt and full HIR tests pass; all six per-arm GC root-dominance audits pass. Full lint remains red with identical main/head failure names and no head-only red. See report.md for the baseline proof, full probe table, controls, tz2 results and sabotage table.
The required initial table contains CPU/RSS/instruction increases, so targeted controls were run rather than declaring it regression-free. Fannkuch JS CPU moves from 8.47/8.81s (+4.01%) to 8.77/8.84s (+0.80%) on the pinned control, with overlapping ranges. Tsc RSS reverses from 221,308/228,936 KiB (+3.45%) to 219,376/219,140 KiB, with overlapping control ranges. Strings JS initially has a small instruction increase with disjoint ranges; a second control remains slightly positive, then six further pinned pairs have five negative deltas and one positive delta, with overlapping pooled ranges. The two strings JS .text sections have identical SHA-256 0760949b581838d4e028934e34b84971a5d082c5f37bdaaa46ecba56b77a8e15. The controls do not reproduce an increase beyond observed variability. All 14 sizes are exactly equal. No demonstrated regression beyond noise remains on these requested programs; the initial results and every control are retained, not replaced or waived.
Risks: this change fixes namespace routing where an actual static value exists; it does not guarantee every built-in static exists. Existing absent methods/getters and unrelated static behavior remain separate. A demonstrated performance or main-to-head Node-parity regression is a blocker.
Base: 4c87719
Head: 1c5e85d39f71960323a5bbf0559433d1443a6cad
Summary by CodeRabbit
URL.canParse,KeyObject.from, and inherited listener-limit methods.