[JSC] Do not use asArrayModes() with Structures because it discards TypedArray inform...
[WebKit-https.git] / JSTests / stress / global-is-nan.js
1 function shouldBe(actual, expected) {
2     if (actual !== expected)
3         throw new Error(`bad value: ${actual}`);
4 }
5 for (var i = -1e4; i < 1e4; ++i)
6     shouldBe(isNaN(i), false);
7
8 // Emit DoubleRep.
9 for (var i = 0; i < 1e4; ++i) {
10     shouldBe(isNaN(Infinity), false);
11     shouldBe(isNaN(-Infinity), false);
12     shouldBe(isNaN(NaN), true);
13 }
14
15 // Emit ToNumber.
16 for (var i = 0; i < 1e4; ++i)
17     shouldBe(isNaN("0"), false);
18 shouldBe(isNaN("Hello"), true);
19 shouldBe(isNaN("NaN"), true);