<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>198674</bug_id>
          
          <creation_ts>2019-06-07 13:09:51 -0700</creation_ts>
          <short_desc>Can&apos;t extend host objects like URLSearchParameters using JS classes</short_desc>
          <delta_ts>2020-04-17 15:00:12 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore JavaScript</component>
          <version>Safari 12</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=174313</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mikhail V">webrealizer</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>709922234</cc>
    
    <cc>achristensen</cc>
    
    <cc>ashvayka</cc>
    
    <cc>fpizlo</cc>
    
    <cc>keith_miller</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1542914</commentid>
    <comment_count>0</comment_count>
    <who name="Mikhail V">webrealizer</who>
    <bug_when>2019-06-07 13:09:51 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1543043</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-06-07 19:02:49 -0700</bug_when>
    <thetext>&lt;rdar://problem/51543664&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1642856</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2020-04-17 15:00:12 -0700</bug_when>
    <thetext>(In reply to Mikhail V from comment #0)
&gt; s1.test(); // Works in Chrome but breaks in Safari. 

As of r256716, extending URLSearchParams (as well as other DOM constructors) works as expected.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>