2 "This test checks that n % 0 doesn't crash with a floating-point exception."
5 shouldBe("2 % 0", "NaN");
8 shouldBe("n % 0", "NaN");
15 shouldBe("f()", "NaN");
23 shouldBe("g()", "NaN");
25 // Test that reusing a floating point value after use in a modulus works correctly.
26 function nonSpeculativeModReuseInner(argument, o1, o2)
28 // The + operator on objects is a reliable way to avoid the speculative JIT path for now at least.
31 var knownDouble = argument - 0;
32 return knownDouble % 1 + knownDouble;
34 function nonSpeculativeModReuse(argument)
36 return nonSpeculativeModReuseInner(argument, {}, {});
39 shouldBe("nonSpeculativeModReuse(0.5)", "1");