W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Re: [DOM4] Constructor for DOMException?

From: João Eiras <joaoe@opera.com>
Date: Wed, 22 Feb 2012 15:27:41 +0100
To: public-webapps@w3.org
Message-ID: <op.v923sfcz2q99of@joaoe>
On Wed, 22 Feb 2012 00:00:24 +0100, Cameron McCormack <cam@mcc.id.au>  

> Marcos Caceres:
>> So… given that one can fake create a DOMException, and unless there
>> is a valid reason not to allow this that I don't know of…. It would
>> be nice if DOMException just defined a public constructor. This would
>> allow clean prototyping of various APIs in ECMAScript (and give us
>> poor saps who don't know C a chance to implement some Web APIs :) ).
> Web IDL already requires exception interface objects like DOMException  
> to be constructable, due to this:
>    http://dev.w3.org/2006/webapi/WebIDL/#es-exception-call
> and them being Function objects.  The constructor should take a single  
> argument which is the message.

DOMExceptions have both a code and a message. Perhaps the constructor  
should be extended to include both.
Received on Wednesday, 22 February 2012 14:28:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:31 UTC