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

Re: Constructible Exceptions

From: Marcos Caceres <w3c@marcosc.com>
Date: Fri, 23 Mar 2012 14:40:24 +0000
To: Marcos Caceres <marcosscaceres@gmail.com>
Cc: public-script-coord <public-script-coord@w3.org>
Message-ID: <6614CE823B4244FD87603AE9CA465F34@marcosc.com>
On Friday, March 23, 2012 at 2:31 PM, Marcos Caceres wrote:
> Just wondering why it's not possible to put a [Constructor] on an exception?  

Sorry, should qualify this a bit. It is possible to construct the ECMAScript exceptions: Obviously, there are clear use cases for throwing custom TypeErrors, etc.  

The use case for throwing custom WebIDL exceptions is to be able to implement WebIDL interfaces directly in JavaScript (when allowed by the presence of [Constructor])…. though my real use case is to be able to construct DOMExceptions in JS, I'll need to take that up with DOM4.   

Marcos Caceres
Received on Friday, 23 March 2012 14:41:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:06 UTC