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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>19110</bug_id>
          
          <creation_ts>2012-09-28 11:33:04 +0000</creation_ts>
          <short_desc>DOM &quot;throw&quot; algorithm doesn&apos;t seem to use WebIDL &quot;throw&quot; algorithm correctly</short_desc>
          <delta_ts>2012-12-06 09:23:38 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>DOM</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Windows 3.1</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Aryeh Gregor">ayg</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>cam</cc>
    
    <cc>mike</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>74785</commentid>
    <comment_count>0</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2012-09-28 11:33:04 +0000</bug_when>
    <thetext>http://dom.spec.whatwg.org/#concept-throw

says to create a new DOMException, &quot;set&quot; its name and message to something, and then &quot;throw&quot; it in the WebIDL sense.  But WebIDL&apos;s throw algorithm

http://dev.w3.org/2006/webapi/WebIDL/#es-throwing-exceptions

takes the name and message as optional arguments, not an existing exception object.  Nothing says what it means to &quot;set&quot; the name and message (own properties? inherited?).  I think the DOM algorithm needs to be rewritten to match the WebIDL one, because currently the combination doesn&apos;t make sense to me.  Maybe you want something like

  Throw a DOMException, with name equal to name and message equal to an implementation-defined value.

But you need to set the code attribute somehow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75682</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-10-09 14:24:05 +0000</bug_when>
    <thetext>Any suggestions heycam?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79524</commentid>
    <comment_count>2</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2012-12-06 05:13:31 +0000</bug_when>
    <thetext>I extended http://dev.w3.org/2006/webapi/WebIDL/#dfn-throw to take the values to assign to the exception fields, and changed the algorithm in http://dev.w3.org/2006/webapi/WebIDL/#es-throwing-exceptions to set them so.

You can then say:

  Throw a DOMException, with name equal to name, message equal to an
  implementation-defined value, and with code set to blah.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79531</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-12-06 09:23:38 +0000</bug_when>
    <thetext>Thanks!

https://github.com/whatwg/dom/commit/9d1febdfc8d10a186387e1081d5810f4de3cba2b</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>