Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1239)

Unified Diff: test/mjsunit/es6/string-includes.js

Issue 1762183002: Base the right RegExp brand checks on Symbol.match (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Enable newly passing test262 tests Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/es6/string-endswith.js ('k') | test/mjsunit/es6/string-startswith.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/string-includes.js
diff --git a/test/mjsunit/es6/string-includes.js b/test/mjsunit/es6/string-includes.js
index 61bf77948310c2151147507089e8a79ed5379f03..c825ffdc6852496f332f28b1d70b9ef01d1ace24 100644
--- a/test/mjsunit/es6/string-includes.js
+++ b/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));
« no previous file with comments | « test/mjsunit/es6/string-endswith.js ('k') | test/mjsunit/es6/string-startswith.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698