Date.prototype.toISOString and Invalid Date

Douglas Crockford douglas at crockford.com
Wed Jun 10 12:31:59 PDT 2009


Adam Peller scripsit:

> I don't feel strongly on this, but it does strike me as odd that
> a function intended to avoid culturally-sensitive output would use
> an English phrase.  I'd lean towards IE/Opera, using notation from
> ECMAScript that is equally cryptic to all cultures :-)  At least that
> would be consistent with Number.toString() and would reinforce the fact
> that there are other methods to produce strings in the user's locale.

I think this is what exceptions are for. 
An English string makes little sense. 
NaN is nonsense.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es5-discuss/attachments/20090610/2270f6c9/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es5-discuss/attachments/20090610/2270f6c9/attachment-0001.gif>


More information about the es5-discuss mailing list