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

Re: Should Exceptions be Errors in the ECMAScript bindings?

From: Anne van Kesteren <annevk@opera.com>
Date: Wed, 18 Apr 2012 21:55:21 +0200
To: "public-script-coord@w3.org" <public-script-coord@w3.org>, "Erik Arvidsson" <arv@chromium.org>
Message-ID: <op.wcy8ajd764w2qv@annevk-macbookpro.local>
On Wed, 18 Apr 2012 20:32:59 +0200, Erik Arvidsson <arv@chromium.org>  
wrote:
> I assume this has been covered before but I could not find any
> previous discussion.
>
> Would it make sense to make DOM exceptions be Error objects in the
> ECMAScript bindings? The reason this came up (again) is that some
> engines provide stack traces on Error objects and developers also want
> this on DOMExceptions. If DOMExceptions where real Errors engines
> would get that feature for "free".

FWIW, if we can do this without breaking compatibility (someone has to try  
it I suppose), that works for me. I think the main thing we are stuck with  
is that a code member needs to exist on the exception object which needs  
to be properly initialized for legacy exceptions (DOM standard has the  
details). Though probably typeof checks exist as well already...


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Wednesday, 18 April 2012 19:55:57 UTC

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