summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/symbol/not.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/jit-test/tests/symbol/not.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/symbol/not.js b/js/src/jit-test/tests/symbol/not.js
new file mode 100644
index 0000000000..7237b0b36c
--- /dev/null
+++ b/js/src/jit-test/tests/symbol/not.js
@@ -0,0 +1,13 @@
+for (var i = 0; i < 9; i++)
+ assertEq(!Symbol(), false, "symbols are truthy");
+
+var a = [0, 0, 0, 0, 0, Symbol(), Symbol()];
+var b = [];
+function f(i, v) {
+ b[i] = !v;
+}
+for (var i = 0; i < a.length; i++)
+ f(i, a[i]);
+assertEq(b[b.length - 3], true);
+assertEq(b[b.length - 2], false);
+assertEq(b[b.length - 1], false);