Error objects: RangeError, TypeError, ValueError

David Herman dherman at mozilla.com
Tue Nov 29 14:27:37 PST 2011


On Nov 28, 2011, at 12:30 PM, Norbert Lindenberg wrote:

> 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.


RangeError is the wrong choice here. TypeError fits within JS tradition. I agree that ValueError is redundant, but it should be replaced by TypeError rather than RangeError. The intuition of a type as describing a "set of expected values" tends to work well for JS.

Dave



More information about the es-discuss mailing list