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
198674
Can't extend host objects like URLSearchParameters using JS classes
https://bugs.webkit.org/show_bug.cgi?id=198674
Summary
Can't extend host objects like URLSearchParameters using JS classes
Mikhail V
Reported
2019-06-07 13:09:51 PDT
This is something that works in other browsers like Chrome but fails in Safari. Try executing code like this class MyParams extends URLSearchParams { constructor(init) { super(init) } test() { alert(1); } } var s1 = new MyParams(); s1.test(); // Works in Chrome but breaks in Safari. I understand that extending host object might be just prohibited but it is hard to find any docs on that or confirmation. Could you clarify what is going on here and why WebKit team decided to block something useful like this.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2019-06-07 19:02:49 PDT
<
rdar://problem/51543664
>
Alexey Shvayka
Comment 2
2020-04-17 15:00:12 PDT
(In reply to Mikhail V from
comment #0
)
> s1.test(); // Works in Chrome but breaks in Safari.
As of
r256716
, 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