Hi,
I'm currently trying to implement a spec using ECMAScript. Unfortunately, I
have a bunch of DOMExceptions that can't be thrown cleanly because there is no
way to instantiate a DOMException through ECMAScript (new DOMException(...)
returns a "TypeError: Illegal constructor" in browsers).
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 sap
On Wed, 22 Feb 2012 00:00:24 +0100, Cameron McCormack
wrote:
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 cle
On Wed, 22 Feb 2012 15:27:41 +0100, João Eiras wrote:
On Wed, 22 Feb 2012 00:00:24 +0100, Cameron McCormack
wrote:
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 b
João Eiras:
DOMExceptions have both a code and a message. Perhaps the
constructor should be extended to include both.
Anne van Kesteren:
code is legacy, but name would be good to expose.
The constructor has the same signature as the standard ECMAScript Error
constructors, so we are being co
On Thu, 23 Feb 2012 00:57:54 +0100, Cameron McCormack
wrote:
João Eiras:
DOMExceptions have both a code and a message. Perhaps the
constructor should be extended to include both.
Anne van Kesteren:
code is legacy, but name would be good to expose.
The constructor has the same signature