WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
Bug 204544
`URLSearchParams` cannot be extended
https://bugs.webkit.org/show_bug.cgi?id=204544
Summary
`URLSearchParams` cannot be extended
709922234
Reported
2019-11-22 19:10:21 PST
Created
attachment 384224
[details]
Safari webconsole ``` class QueryString extends URLSearchParams { toString() { const string = super.toString(); return string ? `?${string}` : ''; } } new QueryString({a: 1, b: 2}).toString() ``` Expectation: "?a=1&b=2" Actual: "a=1&b=2"
Attachments
Safari webconsole
(50.99 KB, image/png)
2019-11-22 19:10 PST
,
709922234
no flags
Details
Firefox webconsole
(52.59 KB, image/png)
2019-11-22 19:11 PST
,
709922234
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
709922234
Comment 1
2019-11-22 19:11:00 PST
Created
attachment 384225
[details]
Firefox webconsole
Radar WebKit Bug Importer
Comment 2
2019-11-23 12:09:06 PST
<
rdar://problem/57454362
>
Alexey Shvayka
Comment 3
2020-03-22 10:23:12 PDT
(In reply to 709922234 from
comment #0
)
> Expectation: "?a=1&b=2" > Actual: "a=1&b=2"
As of
https://trac.webkit.org/changeset/256716
, extending URLSearchParams (as well as other DOM constructors) works as expected.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug