Bug 204544

Summary: `URLSearchParams` cannot be extended
Product: WebKit Reporter: 709922234
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: achristensen, ashvayka, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: macOS 10.14   
See Also: https://bugs.webkit.org/show_bug.cgi?id=174313
Attachments:
Description Flags
Safari webconsole
none
Firefox webconsole none

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
Firefox webconsole (52.59 KB, image/png)
2019-11-22 19:11 PST, 709922234
no flags
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
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.