diff options
Diffstat (limited to 'deps/v8/test/mjsunit/es6/string-includes.js')
-rw-r--r-- | deps/v8/test/mjsunit/es6/string-includes.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/es6/string-includes.js b/deps/v8/test/mjsunit/es6/string-includes.js index 61bf779483..c825ffdc68 100644 --- a/deps/v8/test/mjsunit/es6/string-includes.js +++ b/deps/v8/test/mjsunit/es6/string-includes.js @@ -162,3 +162,11 @@ assertThrows("String.prototype.includes.apply({ 'toString': function() { " + "throw RangeError(); } }, [/./])", RangeError); assertThrows("String.prototype.includes.apply({ 'toString': function() { " + "return 'abc'; } }, [/./])", TypeError); + +// includes does its brand checks with Symbol.match +var re = /./; +assertThrows(function() { + "".includes(re); +}, TypeError); +re[Symbol.match] = false; +assertEquals(false, "".includes(re)); |