Re: Constructible Exceptions

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