summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/inlining/isFiniteInline.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/ion/inlining/isFiniteInline.js')
-rw-r--r--js/src/jit-test/tests/ion/inlining/isFiniteInline.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/inlining/isFiniteInline.js b/js/src/jit-test/tests/ion/inlining/isFiniteInline.js
new file mode 100644
index 000000000..c61191ee5
--- /dev/null
+++ b/js/src/jit-test/tests/ion/inlining/isFiniteInline.js
@@ -0,0 +1,15 @@
+/* Test inlining of Number.isFinite() */
+
+for (var i = 0; i < 200000; i++) {
+ assertEq(Number.isFinite(NaN), false);
+ assertEq(Number.isFinite(-NaN), false);
+ assertEq(Number.isFinite(+Infinity), false);
+ assertEq(Number.isFinite(-Infinity), false);
+ assertEq(Number.isFinite(3), true);
+ assertEq(Number.isFinite(3.141592654), true);
+ assertEq(Number.isFinite(+0), true);
+ assertEq(Number.isFinite(-0), true);
+ assertEq(Number.isFinite(-3), true);
+ assertEq(Number.isFinite(-3.141592654), true);
+ assertEq(Number.isFinite({}), false);
+}