Skip to content

fix(url): coerce URL string arguments#3473

Merged
proggeramlug merged 4 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-url-string-coercion
May 31, 2026
Merged

fix(url): coerce URL string arguments#3473
proggeramlug merged 4 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-url-string-coercion

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

  • Coerce URLSearchParams method name/value arguments with URL string coercion so numbers, null, and objects stringify like Node, while symbols throw.
  • Preserve JavaScript argument evaluation order before coercion and throw Node-compatible ERR_MISSING_ARGS for missing required name / value arguments.
  • Coerce domainToASCII / domainToUnicode inputs before host parsing, including numeric host normalization.

Issues

Fixes #3057
Fixes #3059

Why Batched

Both issues are node:url string conversion gaps and share the same runtime coercion/error semantics and parity surface.

Tests

  • NO_COLOR=1 FORCE_COLOR=0 node --experimental-strip-types test-parity/node-suite/url/search-params/method-argument-coercion.ts
  • NO_COLOR=1 FORCE_COLOR=0 node --experimental-strip-types test-parity/node-suite/url/module/domain-input-coercion.ts
  • PERRY_NO_AUTO_OPTIMIZE=1 ./run_parity_tests.sh --suite node-suite --module url/search-params
  • PERRY_NO_AUTO_OPTIMIZE=1 ./run_parity_tests.sh --suite node-suite --module url/module
  • cargo fmt --all -- --check
  • git diff --check
  • ./scripts/check_file_size.sh
  • cargo check -p perry-hir -p perry-codegen -p perry-runtime -p perry

Known Limitations / Non-Goals

Ralph Küpper added 3 commits May 31, 2026 00:09
…d collision

Tag 12037 collided with NativePodView after merging main. Reassign to
next unused tag 12049.
# Conflicts:
#	crates/perry-codegen/src/expr/url_main.rs
#	crates/perry-codegen/src/runtime_decls/stdlib_ffi.rs
#	crates/perry-runtime/src/url/node_compat.rs
@proggeramlug proggeramlug merged commit a54f3dc into PerryTS:main May 31, 2026
10 of 11 checks passed
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.

node:url: coerce domainToASCII and domainToUnicode inputs node:url: coerce URLSearchParams method arguments

2 participants