This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 19110 - DOM "throw" algorithm doesn't seem to use WebIDL "throw" algorithm correctly
Summary: DOM "throw" algorithm doesn't seem to use WebIDL "throw" algorithm correctly
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: All Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-28 11:33 UTC by Aryeh Gregor
Modified: 2012-12-06 09:23 UTC (History)
3 users (show)

See Also:


Attachments

Description Aryeh Gregor 2012-09-28 11:33:04 UTC
http://dom.spec.whatwg.org/#concept-throw

says to create a new DOMException, "set" its name and message to something, and then "throw" it in the WebIDL sense.  But WebIDL'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 "set" 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'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.
Comment 1 Anne 2012-10-09 14:24:05 UTC
Any suggestions heycam?
Comment 2 Cameron McCormack 2012-12-06 05:13:31 UTC
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.