summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/regexpLastIndex.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/regexpLastIndex.js')
-rw-r--r--js/src/jit-test/tests/basic/regexpLastIndex.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/regexpLastIndex.js b/js/src/jit-test/tests/basic/regexpLastIndex.js
new file mode 100644
index 0000000000..80991fa4b9
--- /dev/null
+++ b/js/src/jit-test/tests/basic/regexpLastIndex.js
@@ -0,0 +1,13 @@
+function regexpLastIndex()
+{
+ var n = 0;
+ var re = /hi/g;
+ var ss = " hi hi hi hi hi hi hi hi hi hi";
+ for (var i = 0; i < 10; i++) {
+ // re.exec(ss);
+ n += (re.lastIndex > 0) ? 3 : 0;
+ re.lastIndex = 0;
+ }
+ return n;
+}
+assertEq(regexpLastIndex(), 0);