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

Unified Diff: src/js/string.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 | « src/js/regexp.js ('k') | test/mjsunit/es6/string-endswith.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/string.js
diff --git a/src/js/string.js b/src/js/string.js
index a4019784e8ec1239ded42118be62df9eb6bd204c..8cab5bb601159623df48eb3cbdfcd8ecf2600b02 100644
--- a/src/js/string.js
+++ b/src/js/string.js
@@ -15,6 +15,7 @@ var GlobalRegExp = global.RegExp;
var GlobalString = global.String;
var InternalArray = utils.InternalArray;
var InternalPackedArray = utils.InternalPackedArray;
+var IsRegExp;
var MakeRangeError;
var MakeTypeError;
var MaxSimple;
@@ -28,6 +29,7 @@ var splitSymbol = utils.ImportNow("split_symbol");
utils.Import(function(from) {
ArrayIndexOf = from.ArrayIndexOf;
ArrayJoin = from.ArrayJoin;
+ IsRegExp = from.IsRegExp;
MakeRangeError = from.MakeRangeError;
MakeTypeError = from.MakeTypeError;
MaxSimple = from.MaxSimple;
@@ -701,7 +703,7 @@ function StringStartsWith(searchString, position) { // length == 1
var s = TO_STRING(this);
- if (IS_REGEXP(searchString)) {
+ if (IsRegExp(searchString)) {
throw MakeTypeError(kFirstArgumentNotRegExp, "String.prototype.startsWith");
}
@@ -727,7 +729,7 @@ function StringEndsWith(searchString, position) { // length == 1
var s = TO_STRING(this);
- if (IS_REGEXP(searchString)) {
+ if (IsRegExp(searchString)) {
throw MakeTypeError(kFirstArgumentNotRegExp, "String.prototype.endsWith");
}
@@ -754,7 +756,7 @@ function StringIncludes(searchString, position) { // length == 1
var string = TO_STRING(this);
- if (IS_REGEXP(searchString)) {
+ if (IsRegExp(searchString)) {
throw MakeTypeError(kFirstArgumentNotRegExp, "String.prototype.includes");
}
« no previous file with comments | « src/js/regexp.js ('k') | test/mjsunit/es6/string-endswith.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698