Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upURLSearchParams constructor interprets an array as a record #24406
Comments
|
@highfive assign me BTW, is it expected that the bot just adds a label without actually adding me as an assignee? |
|
Hey @saschanaz! Thanks for your interest in working on this issue. It's now assigned to you! |
Yes, |
|
Btw, maybe it's good to add the testcase you gave into this one servo/tests/wpt/web-platform-tests/url/urlsearchparams-constructor.any.js Lines 150 to 158 in 1f64024 |
|
This is a general binding problem so it's possible that there already is a failing test elsewhere. I might check after implementing a fix. |
[WIP] Match sequence only when the value is iterable <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #24406 <!-- Either: --> - [ ] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Throw when failing to convert sequence inner values Returning `Ok(ConversionResult::Failure)` allows the code to try other conversion in a union type, but [per the spec there is no such failover](https://heycam.github.io/webidl/#es-union) given that the type is iterable. For servo/servo#24406.
Throw when failing to convert sequence inner values <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #24406 <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Throw when failing to convert sequence inner values <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #24406 <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Expected: An error, because the constructor requires
sequence<sequence<USVString>>.Actual: Instead it interprets as a record, so the result is
0=ab&length=1. The spec says sequences and records are distinguishable, so this shouldn't happen.See also #19776 which is also a distinguishablity problem.