summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/es6/regexp-sticky.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/es6/regexp-sticky.js')
-rw-r--r--deps/v8/test/mjsunit/es6/regexp-sticky.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/es6/regexp-sticky.js b/deps/v8/test/mjsunit/es6/regexp-sticky.js
index c0633f9173..df39763694 100644
--- a/deps/v8/test/mjsunit/es6/regexp-sticky.js
+++ b/deps/v8/test/mjsunit/es6/regexp-sticky.js
@@ -128,3 +128,10 @@ mhat.lastIndex = 2;
assertFalse(mhat.test("..foo"));
mhat.lastIndex = 2;
assertTrue(mhat.test(".\nfoo"));
+
+// Check that we don't apply incorrect optimization to sticky regexps that
+// are anchored at end.
+var stickyanchored = /bar$/y;
+assertFalse(stickyanchored.test("foobar"));
+stickyanchored.lastIndex = 3;
+assertTrue(stickyanchored.test("foobar"));