Skip to content

Reify Number and String static function values - #4629

Closed
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-globals-number-string-statics-20260605
Closed

Reify Number and String static function values#4629
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-globals-number-string-statics-20260605

Conversation

@andrewtdiz

@andrewtdiz andrewtdiz commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Refs #4627

Summary:

  • Reifies captured Number.isInteger / Number.isSafeInteger value reads so they expose callable functions with Node-shaped .name/.length metadata.
  • Installs String.fromCharCode / String.fromCodePoint / String.raw constructor static closures and keeps direct-call fast paths intact.
  • Adds focused globals parity coverage for metadata descriptors, direct calls, detached calls, and adjacent Number.parseInt / Number.isNaN invariants.

Why batched:

Tests:

  • Added test-parity/node-suite/globals/number-string-static-values.ts.

Validation:

  • Focused globals parity: --filter number-string-static-values (1 pass / 0 fail / 0 compile fail).
  • Direct Node 22 and Node 26 fixture diffs matched Perry output.
  • Adjacent direct no-auto diffs matched Node for builtin-namespace-method-values and builtin-constructor-own-name-length.
  • cargo fmt --all -- --check
  • cargo check -p perry-hir -p perry-runtime
  • ./scripts/check_file_size.sh
  • git diff --check

Known limitations:

  • The existing builtin-name-length-descriptors fixture still exits under Node due ESM strict assignment to a read-only function name, so it was not used as a passing adjacency check.

Non-goals:

@andrewtdiz andrewtdiz changed the title fix(runtime): reify Number and String static function values Reify Number and String static function values Jun 5, 2026
@andrewtdiz
andrewtdiz marked this pull request as ready for review June 5, 2026 17:04
@proggeramlug

Copy link
Copy Markdown
Contributor

Superseded: every Number/String static this reifies (isInteger, isSafeInteger, fromCharCode, fromCodePoint, raw) already landed on main via #4627 — both the HIR gate and runtime installs. No new methods here. Thanks @andrewtdiz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants