summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testUndefinedIncrement.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/testUndefinedIncrement.js')
-rw-r--r--js/src/jit-test/tests/basic/testUndefinedIncrement.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testUndefinedIncrement.js b/js/src/jit-test/tests/basic/testUndefinedIncrement.js
new file mode 100644
index 000000000..a42557b3b
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testUndefinedIncrement.js
@@ -0,0 +1,15 @@
+function f() {
+ var n;
+ var k;
+ for (var i = 0; i < 18; ++i) {
+ n = undefined;
+ k = n++;
+ if (k) { }
+ }
+ return [k, n];
+}
+
+var [a, b] = f();
+
+assertEq(isNaN(a), true);
+assertEq(isNaN(b), true);