summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testNullToString.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/testNullToString.js')
-rw-r--r--js/src/jit-test/tests/basic/testNullToString.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testNullToString.js b/js/src/jit-test/tests/basic/testNullToString.js
new file mode 100644
index 0000000000..c80feb1da1
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testNullToString.js
@@ -0,0 +1,13 @@
+function testNullToString()
+{
+ var a = [];
+ for (var i = 0; i < 10; i++)
+ a.push(String(null));
+ for (i = 0; i < 10; i++) {
+ var t = typeof a[i];
+ if (t != "string")
+ a.push(t);
+ }
+ return a.join(",");
+}
+assertEq(testNullToString(), "null,null,null,null,null,null,null,null,null,null");