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

Unified Diff: src/js/string.js

Issue 2350963004: [builtins] Move StringIndexOf to a C++ builtin. (Closed)
Patch Set: Fix formatting errors Created 4 years, 2 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/i18n.js ('k') | src/objects.h » ('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 7c552a93a97026bbcdf57fbd79fda017e7a9eea2..28e74a50cb1fb28af37f9ec63aef39d031fcd423 100644
--- a/src/js/string.js
+++ b/src/js/string.js
@@ -46,21 +46,6 @@ function StringConcat(other /* and more */) { // length == 1
}
-// ECMA-262 section 15.5.4.7
-function StringIndexOf(pattern, position) { // length == 1
- CHECK_OBJECT_COERCIBLE(this, "String.prototype.indexOf");
-
- var subject = TO_STRING(this);
- pattern = TO_STRING(pattern);
- var index = TO_INTEGER(position);
- if (index < 0) index = 0;
- if (index > subject.length) index = subject.length;
- return %StringIndexOf(subject, pattern, index);
-}
-
-%FunctionSetLength(StringIndexOf, 1);
-
-
// ES6 21.1.3.11.
function StringMatchJS(pattern) {
CHECK_OBJECT_COERCIBLE(this, "String.prototype.match");
@@ -535,7 +520,6 @@ utils.InstallFunctions(GlobalString.prototype, DONT_ENUM, [
"concat", StringConcat,
"endsWith", StringEndsWith,
"includes", StringIncludes,
- "indexOf", StringIndexOf,
"match", StringMatchJS,
"repeat", StringRepeat,
"replace", StringReplace,
@@ -567,7 +551,6 @@ utils.InstallFunctions(GlobalString.prototype, DONT_ENUM, [
// Exports
utils.Export(function(to) {
- to.StringIndexOf = StringIndexOf;
to.StringMatch = StringMatchJS;
to.StringReplace = StringReplace;
to.StringSlice = StringSlice;
« no previous file with comments | « src/js/i18n.js ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698