diff options
Diffstat (limited to 'src/3rdparty/v8/test/mjsunit/regexp.js')
-rw-r--r-- | src/3rdparty/v8/test/mjsunit/regexp.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/3rdparty/v8/test/mjsunit/regexp.js b/src/3rdparty/v8/test/mjsunit/regexp.js index ec82c96..c2d9282 100644 --- a/src/3rdparty/v8/test/mjsunit/regexp.js +++ b/src/3rdparty/v8/test/mjsunit/regexp.js @@ -705,3 +705,14 @@ assertThrows("RegExp('(?!*)')"); // Test trimmed regular expression for RegExp.test(). assertTrue(/.*abc/.test("abc")); assertFalse(/.*\d+/.test("q")); + +// Test that RegExp.prototype.toString() throws TypeError for +// incompatible receivers (ES5 section 15.10.6 and 15.10.6.4). +assertThrows("RegExp.prototype.toString.call(null)", TypeError); +assertThrows("RegExp.prototype.toString.call(0)", TypeError); +assertThrows("RegExp.prototype.toString.call('')", TypeError); +assertThrows("RegExp.prototype.toString.call(false)", TypeError); +assertThrows("RegExp.prototype.toString.call(true)", TypeError); +assertThrows("RegExp.prototype.toString.call([])", TypeError); +assertThrows("RegExp.prototype.toString.call({})", TypeError); +assertThrows("RegExp.prototype.toString.call(function(){})", TypeError); |