[Webkit-unassigned] [Bug 198674] New: Can't extend host objects like URLSearchParameters using JS classes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 7 13:09:51 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=198674

            Bug ID: 198674
           Summary: Can't extend host objects like URLSearchParameters
                    using JS classes
           Product: WebKit
           Version: Safari 12
          Hardware: Macintosh
                OS: macOS 10.14
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore JavaScript
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: webrealizer at gmail.com

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190607/866205a2/attachment.html>


More information about the webkit-unassigned mailing list