diff options
Diffstat (limited to 'js/src/jit-test/tests/regexp/lastIndex-too-large.js')
-rw-r--r-- | js/src/jit-test/tests/regexp/lastIndex-too-large.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/regexp/lastIndex-too-large.js b/js/src/jit-test/tests/regexp/lastIndex-too-large.js new file mode 100644 index 0000000000..3e04042dd0 --- /dev/null +++ b/js/src/jit-test/tests/regexp/lastIndex-too-large.js @@ -0,0 +1,13 @@ +function test() { + var re = /abc.+de/y; + for (var i = 0; i < 100; i++) { + re.lastIndex = 10; + assertEq(re.exec("abcXdef"), null); + assertEq(re.lastIndex, 0); + + re.lastIndex = 10; + assertEq(re.test("abcXdef"), false); + assertEq(re.lastIndex, 0); + } +} +test(); |