Error objects: RangeError, TypeError, ValueError

Norbert Lindenberg ecmascript at
Mon Nov 28 12:30:25 PST 2011

Sounds like RangeError is the one to use for the Globalization API. If I don't hear objections, I'll remove ValueError from the spec, replace its uses with RangeError, and file a ticket against the language specification to have the word "numeric" removed from the description of RangeError.


On Nov 22, 2011, at 10:14 , Brendan Eich wrote:

> On Nov 22, 2011, at 9:37 AM, Allen Wirfs-Brock wrote:
>> Range error actually has fairly limited usage in the current specification.  Enough so, that it arguably doesn't carry its weight as one of the very few available exceptions "classes".    I think we could reasonably drop the "numeric" from its prose description and use it for all (new) situations where a provided value is of the correct "type" but outside the set of acceptable values of that type. 
> Pedants and wannabes like me will object to "Range" instead of "Value" (codomain vs. domain :-P). But agreed, we could use RangeError in more places; we could do worse.

More information about the es-discuss mailing list