url: align default argument handling for URLPattern with webidl#62708
Closed
nodejs-github-bot wants to merge 1 commit intomainfrom
Closed
url: align default argument handling for URLPattern with webidl#62708nodejs-github-bot wants to merge 1 commit intomainfrom
nodejs-github-bot wants to merge 1 commit intomainfrom
Conversation
Collaborator
Author
|
Review requested:
|
panva
previously approved these changes
Apr 12, 2026
Collaborator
Author
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62708 +/- ##
==========================================
- Coverage 89.81% 89.79% -0.03%
==========================================
Files 699 699
Lines 216379 216396 +17
Branches 41366 41382 +16
==========================================
- Hits 194340 194302 -38
- Misses 14139 14183 +44
- Partials 7900 7911 +11
🚀 New features to boost your workflow:
|
Member
|
cc @nodejs/url |
4d0d15f to
fc6ba8d
Compare
fc6ba8d to
d01f20c
Compare
lpinca
approved these changes
Apr 12, 2026
KhafraDev
approved these changes
Apr 12, 2026
Collaborator
Author
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
d01f20c to
da14246
Compare
Member
|
I'll reopen this as my own PR. -> #62719 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligns URLPattern's argument handling with WebIDL semantics (to some extent at least), matching browser behavior (verified against Chrome):
Constructor:
undefined/nullfor URLPatternInput (arg0) uses default empty init per WebIDL union-with-dictionary rules.null/undefinedresolve to default options rather than being treated as baseURL.null/undefinedfor baseURL (USVString) are stringified to"null"/"undefined"per WebIDL, which ada rejects as invalid URLs.null/undefinedfor options dictionary uses defaults.test() / exec():
null/undefinedfor input uses default empty init.nullfor baseURL is stringified to"null"per WebIDL USVString conversion, letting the underlying library handle the error semantics (dict input + baseURL throws; string input + invalid baseURL returns no match).ignoreCase:
IsBoolean()type check toBooleanValue()coercion per WebIDL dictionary boolean member rules.Tests:
f07c03cbed.test/parallel/test-urlpattern-types.js.