<?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>174216</bug_id>
          
          <creation_ts>2017-07-06 14:12:22 -0700</creation_ts>
          <short_desc>Update DOMException to the latest spec</short_desc>
          <delta_ts>2017-07-20 19:10:43 -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>Bindings</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>174702</dependson>
    
    <dependson>174597</dependson>
    
    <dependson>174603</dependson>
    
    <dependson>174630</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Domenic Denicola">d</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annevk</cc>
    
    <cc>cdumez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1326176</commentid>
    <comment_count>0</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2017-07-06 14:12:22 -0700</bug_when>
    <thetext>For years the spec for DOMException has not matched what was implemented. We recently fixed this by converging on the majority behavior, in https://github.com/heycam/webidl/pull/378. Failing-in-Safari tests are available at:

- http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-behavior.any.html
- http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-behavior.any.html
- http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/exceptions.html

The spec is at:

- https://heycam.github.io/webidl/#idl-DOMException
- https://heycam.github.io/webidl/#idl-DOMException

The following changes appear to be necessary to conform to the current spec:

- Use getters on the prototype instead of own data properties for message/code/name.
- Removing the toString() method and letting the default Error.prototype.toString() show through.
- (&quot;should&quot;, not &quot;must&quot;) capturing stack traces for DOMExceptions, like for other Error classes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1328739</commentid>
    <comment_count>1</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2017-07-14 06:26:10 -0700</bug_when>
    <thetext>https://w3c-test.org/url/urlsearchparams-constructor.html also changed because of this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1330830</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2017-07-20 16:44:45 -0700</bug_when>
    <thetext>Fixed in dependency bugs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1330833</commentid>
    <comment_count>3</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2017-07-20 16:47:01 -0700</bug_when>
    <thetext>Any interest in fixing the stack issue? I didn&apos;t see that in the dependency bugs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1330835</commentid>
    <comment_count>4</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2017-07-20 16:54:31 -0700</bug_when>
    <thetext>(In reply to Domenic Denicola from comment #3)
&gt; Any interest in fixing the stack issue? I didn&apos;t see that in the dependency
&gt; bugs.

What stack issue? Is this covered by a web platform test?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1330838</commentid>
    <comment_count>5</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2017-07-20 17:02:14 -0700</bug_when>
    <thetext>The

&gt; - (&quot;should&quot;, not &quot;must&quot;) capturing stack traces for DOMExceptions, like for other Error classes.

And yeah, it&apos;s the last test in http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/DOMException-custom-bindings.any.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1330888</commentid>
    <comment_count>6</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2017-07-20 19:08:15 -0700</bug_when>
    <thetext>(In reply to Domenic Denicola from comment #5)
&gt; The
&gt; 
&gt; &gt; - (&quot;should&quot;, not &quot;must&quot;) capturing stack traces for DOMExceptions, like for other Error classes.
&gt; 
&gt; And yeah, it&apos;s the last test in
&gt; http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/DOMException-
&gt; custom-bindings.any.html

Oh, I see. This does not sound super useful to me and is annoying to implement. I think I&apos;ll leave as is for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1330890</commentid>
    <comment_count>7</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2017-07-20 19:10:43 -0700</bug_when>
    <thetext>(In reply to Chris Dumez from comment #6)
&gt; (In reply to Domenic Denicola from comment #5)
&gt; &gt; The
&gt; &gt; 
&gt; &gt; &gt; - (&quot;should&quot;, not &quot;must&quot;) capturing stack traces for DOMExceptions, like for other Error classes.
&gt; &gt; 
&gt; &gt; And yeah, it&apos;s the last test in
&gt; &gt; http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/DOMException-
&gt; &gt; custom-bindings.any.html
&gt; 
&gt; Oh, I see. This does not sound super useful to me and is annoying to
&gt; implement. I think I&apos;ll leave as is for now.

But I filed https://bugs.webkit.org/show_bug.cgi?id=174702.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>