diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/regexp/builtin-exec-wrapper.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/regexp/builtin-exec-wrapper.js b/js/src/jit-test/tests/regexp/builtin-exec-wrapper.js new file mode 100644 index 0000000000..63660de643 --- /dev/null +++ b/js/src/jit-test/tests/regexp/builtin-exec-wrapper.js @@ -0,0 +1,7 @@ +var g = newGlobal({newCompartment: true}); +g.evaluate(`RegExp.prototype.exec = {};`); +var wrapper = g.evaluate(`/abc.+def/`); +assertEq(RegExp.prototype.test.call(wrapper, "abc"), false); +assertEq(RegExp.prototype.test.call(wrapper, "abcXdef"), true); +assertEq(RegExp.prototype[Symbol.match].call(wrapper, "abc"), null); +assertEq(RegExp.prototype[Symbol.match].call(wrapper, "abcXdef")[0], "abcXdef"); |