René's URL Explorer Experiment


Title: fix: URLSearchParams construction and iteration spec compliance by adrian-niculescu · Pull Request #1970 · NativeScript/android · GitHub

Open Graph Title: fix: URLSearchParams construction and iteration spec compliance by adrian-niculescu · Pull Request #1970 · NativeScript/android

X Title: fix: URLSearchParams construction and iteration spec compliance by adrian-niculescu · Pull Request #1970 · NativeScript/android

Description: While chasing a failing backend request in our app we noticed it was hitting a URL that looked like this: https://api.example.com/items?[object+Object]= The culprit was an innocent new URLSearchParams({ limit: "50", cursor: "abc123" }). The binding only handles the string init form, so any object passed to the constructor gets stringified to "[object Object]" and the whole query collapses into one bogus key. The same code works in browsers and Node, which made it a fun one to track down. This reworks the constructor to follow the WebIDL init dispatch from the URL spec: a plain object is read as a record (own enumerable keys in order; a Symbol key throws), an iterable (Array, Map, Set, another URLSearchParams, generators) is read as a sequence of pairs (with IteratorClose on abrupt completion, and a TypeError for a pair whose length isn't 2), other primitives and null coerce to a USVString and get parsed (a Symbol throws; null parses as the string "null", matching the whatwg-url reference implementation), and undefined produces empty params (the IDL default). Writing tests for that surfaced a few more spec gaps, also fixed here: entries()/keys()/values() returned plain arrays, and there was no @@iterator, so for..of, spread, and the new URLSearchParams(other) copy form didn't work. They now return live ES iterators per spec, with @@iterator aliasing entries. This also fixes a duplicate-key bug: the old get_keys()+get() walk returned the first value for every occurrence of a repeated key. get() returns null for a missing name instead of undefined (one existing test asserted undefined and was updated to match the spec). delete(name, value) and has(name, value) honor the optional value argument, which ada already exposes. An explicit undefined value is treated as omitted, matching WPT. The URLSearchParams test group now has 49 specs covering all of the above. Full suite run on an emulator via runtests: 513 tests, 0 failures. iOS counterpart: NativeScript/ios#388. Update after review: every name and value argument across get/getAll/has/delete/append/set now goes through the same USVString coercion (a Symbol throws), entries()/keys()/values() and the iterator's next() brand-check their receivers, and GetPointer no longer reads an internal field from objects that have none (entries.call({}) used to be an out-of-bounds read). A second pass against the IDL and the whatwg-url reference implementation aligned three more corners: new URLSearchParams(null) parses as the string "null" instead of being treated as empty (the union conversion has no null special case; WPT does not cover it and Node is the outlier), an enumerable Symbol key in a record init throws, and the remaining members (get/getAll/has/append/set/delete/forEach/sort/toString/size) brand-check their receiver like the iterator methods. Summary by CodeRabbit Bug Fixes Iterators (entries/keys/values/default) now behave per spec: live, have correct identity/branding, preserve duplicates, close on errors, and throw on illegal invocation; get() returns null for missing keys. Improvements Constructor accepts records, arrays/pairs, Maps/Sets, generic iterables, primitives, and strips leading ?; delete()/has() support value-based matching with proper coercion and explicit-undefined handling. Tests Expanded coverage for iterators, constructor inputs, edge cases, and error conditions.

Open Graph Description: While chasing a failing backend request in our app we noticed it was hitting a URL that looked like this: https://api.example.com/items?[object+Object]= The culprit was an innocent new URLSearchPa...

X Description: While chasing a failing backend request in our app we noticed it was hitting a URL that looked like this: https://api.example.com/items?[object+Object]= The culprit was an innocent new URLSearchPa...

Opengraph URL: https://github.com/NativeScript/android/pull/1970

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6b9881eb-2c1e-6c81-682b-78219c13b1e1
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD6A4:3D8CBB:1B0AC60:23A5E89:6B014BEF
html-safe-noncee4b8056e877ee6341ce22c25e289704c50373203f57b930848fb1f8a0bf65d0c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkE0OjNEOENCQjoxQjBBQzYwOjIzQTVFODk6NkIwMTRCRUYiLCJ2aXNpdG9yX2lkIjoiMjE3MDQ5NDQ3ODI0OTQ0NjM4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb443fd8e578a0fbf31e508927aa508d742df936b0e435e855a78ff88c3d8796e
hovercard-subject-tagpull_request:3855011882
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/android/pull/1970/files
twitter:imagehttps://avatars.githubusercontent.com/u/15037449?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/15037449?s=400&v=4
og:image:altWhile chasing a failing backend request in our app we noticed it was hitting a URL that looked like this: https://api.example.com/items?[object+Object]= The culprit was an innocent new URLSearchPa...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/android git https://github.com/NativeScript/android.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id29137950
octolytics-dimension-repository_nwoNativeScript/android
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id29137950
octolytics-dimension-repository_network_root_nwoNativeScript/android
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/android/pull/1970/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F1970%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F1970%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2Fandroid
Reloadhttps://github.com/NativeScript/android/pull/1970/files
Reloadhttps://github.com/NativeScript/android/pull/1970/files
Reloadhttps://github.com/NativeScript/android/pull/1970/files
NativeScripthttps://github.com/NativeScript
androidhttps://github.com/NativeScript/android
Codehttps://github.com/NativeScript/android
Issues106 (106)https://github.com/NativeScript/android/issues
Pull requests25 (25)https://github.com/NativeScript/android/pulls
Actionshttps://github.com/NativeScript/android/actions
Projectshttps://github.com/NativeScript/android/projects
Wikihttps://github.com/NativeScript/android/wiki
Security and qualityhttps://github.com/NativeScript/android/security
Insightshttps://github.com/NativeScript/android/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
NathanWalkerhttps://github.com/NathanWalker
NativeScript:mainhttps://github.com/NativeScript/android/tree/main
adrian-niculescu:fix/urlsearchparams-construction-live-iteratorshttps://github.com/adrian-niculescu/NativeScript-Android/tree/fix/urlsearchparams-construction-live-iterators
Conversation 6 https://github.com/NativeScript/android/pull/1970
Commits 5 https://github.com/NativeScript/android/pull/1970/commits
Checks 3 https://github.com/NativeScript/android/pull/1970/checks
Files changed https://github.com/NativeScript/android/pull/1970/files
Please reload this pagehttps://github.com/NativeScript/android/pull/1970/files
fix: URLSearchParams construction and iteration spec compliance https://github.com/NativeScript/android/pull/1970/files#top
Show all changes 5 commits https://github.com/NativeScript/android/pull/1970/files
00a2ef1 fix: URLSearchParams construction and iteration spec compliance adrian-niculescu Jun 12, 2026 https://github.com/NativeScript/android/pull/1970/commits/00a2ef1276b43ffeb799517b839af6b4bec83ecb
1a0ae12 fix: coerce names to USVString and brand-check iterator receivers adrian-niculescu Jun 12, 2026 https://github.com/NativeScript/android/pull/1970/commits/1a0ae120bb1dfddbad264f651533ae65c4f5f643
3945a0d fix: coerce append/set arguments to USVStrings adrian-niculescu Jun 12, 2026 https://github.com/NativeScript/android/pull/1970/commits/3945a0df477e0a483218c92f6ddfb24abaefdd7b
dfcce8c fix: align null init, record Symbol keys, and receiver checks with We… adrian-niculescu Jun 12, 2026 https://github.com/NativeScript/android/pull/1970/commits/dfcce8cc07c86b09f05b20d693f6b7894696a7df
254f7b0 docs: clarify when the sequence init runs IteratorClose adrian-niculescu Jun 12, 2026 https://github.com/NativeScript/android/pull/1970/commits/254f7b083fe07cad9f84eaa959dacc8c297643b7
Clear filters https://github.com/NativeScript/android/pull/1970/files
Please reload this pagehttps://github.com/NativeScript/android/pull/1970/files
Please reload this pagehttps://github.com/NativeScript/android/pull/1970/files
testURLSearchParamsImpl.js https://github.com/NativeScript/android/pull/1970/files#diff-cdc71659a930435627c25f5512824a0c2ef95c8dbf44e04890634a94d90bde5c
URLSearchParamsImpl.cpp https://github.com/NativeScript/android/pull/1970/files#diff-8d4a649ed796ccfd35ca0ebe2d7b01efa19dede1d15f6487860ee7595d9c1442
Please reload this pagehttps://github.com/NativeScript/android/pull/1970/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.