<?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>23346</bug_id>
          
          <creation_ts>2013-09-24 22:10:21 +0000</creation_ts>
          <short_desc>Use TypeError for argument validation</short_desc>
          <delta_ts>2014-05-13 09:29:45 +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>XHR</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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>23367</dependson>
    
    <dependson>24581</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne">annevk</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>hsteen</cc>
    
    <cc>jungkees</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
    
    <cc>VYV03354</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>93750</commentid>
    <comment_count>0</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-24 22:10:21 +0000</bug_when>
    <thetext>Rather than using a mix of DOMException and TypeError we should probably just use TypeError for argument validation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93789</commentid>
    <comment_count>1</comment_count>
    <who name="Masatoshi Kimura">VYV03354</who>
    <bug_when>2013-09-25 13:22:54 +0000</bug_when>
    <thetext>I don&apos;t think TypeError is appropriate for syntax errors in the header field.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93790</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-25 13:24:19 +0000</bug_when>
    <thetext>Based on what? TypeError is what JavaScript uses for argument validation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93792</commentid>
    <comment_count>3</comment_count>
    <who name="Masatoshi Kimura">VYV03354</who>
    <bug_when>2013-09-25 13:42:13 +0000</bug_when>
    <thetext>What about non-ECMAScript bindings?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93794</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-25 13:53:26 +0000</bug_when>
    <thetext>We have stopped caring about those.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93883</commentid>
    <comment_count>5</comment_count>
    <who name="Masatoshi Kimura">VYV03354</who>
    <bug_when>2013-09-26 14:15:10 +0000</bug_when>
    <thetext>(In reply to Anne from comment #2)
&gt; TypeError is what JavaScript uses for argument validation.

That&apos;s untrue. JSON.parse will throw SyntaxError if the first argument is invalid as JSON.
http://ecma-international.org/ecma-262/5.1/#sec-15.12.2
Also, the RegExp constructor will throw SyntaxError if the first argument is unparsable as a regular expression.
http://ecma-international.org/ecma-262/5.1/#sec-15.10.4.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93979</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-27 19:46:53 +0000</bug_when>
    <thetext>The JSON bit is an admitted mistake. Using SyntaxError for RegExp is intentional I believe as it&apos;s intended for syntax errors in JavaScript source code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95305</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-24 13:59:36 +0000</bug_when>
    <thetext>So looking at https://github.com/whatwg/xhr/pull/12 and the other exceptions we have in the specification. Should we consolidate more? Maybe we should hold off on this one until exceptions have moved to IDL completely?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101604</commentid>
    <comment_count>8</comment_count>
    <who name="Hallvord R. M. Steen">hsteen</who>
    <bug_when>2014-02-28 09:46:16 +0000</bug_when>
    <thetext>Anne, 
we have tests testing that the &quot;right&quot; error is being thrown. Now, moving the spec forward will eventually depend on conformance as determined by the test suite.. So you deciding to wait with this change puts us in a somewhat awkward position: do we ship tests that follow the spec-as-is but test for something we do *not* want the spec to say eventually? Or ship tests that contradict the spec in its current form?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102460</commentid>
    <comment_count>9</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-03-17 16:04:46 +0000</bug_when>
    <thetext>Hallvord, I guess we should just not do this and avoid churn. However, given how IDL might change around ByteString and such we might have some exception changes down the road.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105815</commentid>
    <comment_count>10</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-05-13 07:29:50 +0000</bug_when>
    <thetext>Please make the specs match each other.

See https://github.com/w3c/web-platform-tests/pull/974</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105823</commentid>
    <comment_count>11</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-13 09:29:45 +0000</bug_when>
    <thetext>I don&apos;t see what needs to be fixed on the WHATWG side here.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>