Skip to content

Conversation

@mattermoran
Copy link
Contributor

@mattermoran mattermoran commented Dec 19, 2025

Fixes the issue where byte replacement characters could result in duplicate entries when constructing URLSearchParams from a record.

While current implementation follows the spec to the word:

Otherwise, if init is a record, then for each name → value of init, append (name, value) to query’s list.

using params_append() directly happens before the USVString conversion so that keys that are supposed to collide after conversion can be added as separate entries.

By using params_set() we get the correct behavior without having to normalize the record beforehand.

Extending maybe_consume_sequence_or_record with separate sequence and record handlers allows applying different behavior.

Passes 2 remaining tests for URLSearchParams constructor.

@mattermoran mattermoran force-pushed the fix/urlsearchparams-record-constructor branch 2 times, most recently from 7b5fa11 to a2dcba3 Compare December 19, 2025 01:19
@mattermoran mattermoran force-pushed the fix/urlsearchparams-record-constructor branch from a2dcba3 to ad8af2c Compare December 19, 2025 01:32
Copy link
Member

@andreiltd andreiltd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tschneidereit tschneidereit merged commit d591115 into bytecodealliance:main Dec 19, 2025
6 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.

3 participants