On Oct 9, 2013, at 1:35 AM, Claude Pache <claude.pa...@gmail.com> wrote:

> 
> Le 8 oct. 2013 à 23:43, Andrew Fedoniouk <n...@terrainformatica.com> a écrit :
> 
>> Quite often Date values are used in data exchanges in form of JS
>> literals or JSON.
>> 
>> It would be beneficial if JS (and JSON as derivative) will have an
>> ability to represent dates literally  . For example:
> 
> Even if there had been a dedicated syntax to write literal dates in JS, it 
> doesn't mean that JSON would have allowed such a representation.
> For instance, the following entities have literal representation in JS, but 
> do not exist in JSON, by the will of its designer: Infinity, NaN, and regular 
> expressions.

Infinity and NaN a identifiers referencing properties on the global object — 
they’re not literals (nor is undefined).

These are all valid (but you shouldn’t do it):

function f(undefined, NaN, Infinity) {
// dooooooommmmmm
}


function f() {
var undefined = null /* fix that silly null vs. undefined shenanigans */, NaN = 
Math.sqrt(2) /* make sure nan is not rational */, Infinity = 10000000 /* this 
should be big enough */
}

—Oliver
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to