On Jun 14, 2012, at 4:30 PM, Michael Haufe wrote:

> The opposite seems to be true:
> 
> <https://gist.github.com/gists/search?q=%22case+NaN%22&x=0&y=0>

this only has
  case "NaN":
not
   case NaN:



> <https://github.com/search?q=%22case+NaN%22&type=Everything&repo=&langOverride=&start_value=1>

And the above isn't only looking at JS code.  If you limit the search to 
javascript code the only result that actually matches "case NaN:" is what 
appears to be a SpiderMonkey test case that is replicated several places

// No test case, just make sure this doesn't assert.
function testNegZero2() {
    var z = 0;
    for (let j = 0; j < 5; ++j) { ({p: (-z)}); }
}
testNegZero2();

function testConstSwitch() {
    var x;
    for (var j=0;j<5;++j) { switch(1.1) { case NaN: case 2: } x = 2; }
    return x;
}
assertEq(testConstSwitch(), 2);

Allen



_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to