<?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>16470</bug_id>
          
          <creation_ts>2012-03-21 19:22:18 +0000</creation_ts>
          <short_desc>Exception message contruction</short_desc>
          <delta_ts>2012-03-21 22:38:25 +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>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</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="Marcos Caceres">w3c</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>mike</cc>
    
    <cc>public-script-coord</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>65906</commentid>
    <comment_count>0</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2012-03-21 19:22:18 +0000</bug_when>
    <thetext>I might have screwed something up, but implementing the algorithm can result in message becoming &quot;undefined&quot;, from this line: 

Test case:
var test = new FooError() 

Then: 
function(arg0) {
  //.... arg0 is undefined. 
  //If n &gt; 0, then:
   if (arguments.length &gt; 0) {

  //Let S be the result of calling ToString(arg0).
  var S = ECMAScript.ToString(arg0);
 
Maybe the spec should check that arg0 is not undefined? 

Question: can a default message be set somehow in through the IDL?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65909</commentid>
    <comment_count>1</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2012-03-21 19:38:55 +0000</bug_when>
    <thetext>Also, I think the Exception JS binding section is confusing with regards to setting message (when no argument is missing). It should be a bit more clear that ECMAscript Error gives you message and type in the prototype.  

Generally, I&apos;ve struggled a bit with the exception stuff... it is a bit all over the place. I have to bounce between many parts of the spec to find all the bits I need to put it together. It would be much easier if everything was brought together in one place with less critical bits missing from definitions. I guess once I&apos;m done you will be able to see how I had to copy/paste parts of the spec into a kind of Frankenstein... I shouldn&apos;t have to do that when following algorithms (ECMAScript does this really nicely). 

code is here: 

https://github.com/marcoscaceres/ECMAScriptInJS/blob/master/WebIDL.js

Search for &quot;ExceptionFactory&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65926</commentid>
    <comment_count>2</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2012-03-21 22:38:25 +0000</bug_when>
    <thetext>Do you mean that passing undefined to built-in error constructors will result in no message being set, while for Web IDL error constructors it will set the message to &quot;undefined&quot;?  If so, you&apos;re right, we should follow what the built-in ones do.

Default messages cannot be set in the IDL.

I&apos;ve added a clarifying note that setting the message property shadows the one from Error.prototype.

http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml.diff?r1=1.489;r2=1.491;f=h</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>