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

Re: Should Exceptions be Errors in the ECMAScript bindings?

From: Marcos Caceres <w3c@marcosc.com>
Date: Fri, 27 Apr 2012 18:17:10 +0100
To: Erik Arvidsson <arv@chromium.org>
Cc: Travis Leithead <travis.leithead@microsoft.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <C2807AE6A8B04CC6A9B732A05C9FB65A@marcosc.com>


-- 
Marcos Caceres
http://datadriven.com.au


On Friday, 27 April 2012 at 18:12, Erik Arvidsson wrote:

> On Wed, Apr 18, 2012 at 12:09, Travis Leithead
> <travis.leithead@microsoft.com (mailto:travis.leithead@microsoft.com)> wrote:
> > I believe that WebIDL currently requires that DOM exceptions inherit from the ES "Error" prototype. This effectively makes them Errors for most purposes.
> 
> I don't see that anywhere in WebIDL.

See:  
http://www.w3.org/TR/WebIDL/#es-exception-interface-prototype-object 

"
If the exception is declared to inherit from another exception, then the value of the internal [[Prototype]] property is the exception interface prototype object for the inherited exception.
Otherwise, the exception is not declared to inherit from another exception. The value of the internal [[Prototype]] property is the Error prototype object ([ECMA-262], section 15.11.3.1).

"

> Also, IE does not make DOM exceptions have Error.prototype on their
> prototype chain.

Neither do either browsers, AFAIK from testing. Would be nice if they did, I guess. 
Received on Friday, 27 April 2012 17:17:43 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC