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

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

Issue 1506353009: [es6] implement RegExp.@@search. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « src/js/string.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/string-search.js
diff --git a/test/mjsunit/harmony/string-match.js b/test/mjsunit/es6/string-search.js
similarity index 53%
copy from test/mjsunit/harmony/string-match.js
copy to test/mjsunit/es6/string-search.js
index 25a3ca2fd1b691c6ceb52f86c0617fc42c182992..dc029826ad3e6cabbc2e56c0ccb4a2c8d67ac91c 100644
--- a/test/mjsunit/harmony/string-match.js
+++ b/test/mjsunit/es6/string-search.js
@@ -5,16 +5,16 @@
// Flags: --harmony-regexp-subclass
var pattern = {};
-pattern[Symbol.match] = function(string) {
+pattern[Symbol.search] = function(string) {
return string.length;
};
// Check object coercible fails.
-assertThrows(() => String.prototype.match.call(null, pattern),
+assertThrows(() => String.prototype.search.call(null, pattern),
TypeError);
// Override is called.
-assertEquals(5, "abcde".match(pattern));
+assertEquals(5, "abcde".search(pattern));
// Non-callable override.
-pattern[Symbol.match] = "dumdidum";
-assertThrows(() => "abcde".match(pattern), TypeError);
+pattern[Symbol.search] = "dumdidum";
+assertThrows(() => "abcde".search(pattern), TypeError);
-assertEquals("[Symbol.match]", RegExp.prototype[Symbol.match].name);
+assertEquals("[Symbol.search]", RegExp.prototype[Symbol.search].name);
« no previous file with comments | « src/js/string.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698