RE: Exception usage

On Thu, Feb 13, 2014 at 1:57 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
>
> On Wed, Feb 12, 2014 at 11:57 PM, Jacob Rossi <Jacob.Rossi@microsoft.com> wrote:
> > I think TypeError is also inappropriate. The exceptional scenario includes cases where the argument type is correct (number) but the particular value is not.
>
> That's fine. TypeError can be used for many different reasons. See the
> JavaScript specification or ask its author.

I agree TypeError may be suitable. To be transparent, it would take significantly work for IE to implement this (we currently do not have the ability to throw script engine errors from DOM APIs). That's a solvable problem, but I'm not sure I understand its value. Why isn't providing a more descriptive error name (as currently spec'd) better for the developer?

Received on Friday, 14 February 2014 21:58:10 UTC