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

Unified Diff: src/js/string.js

Issue 2351643002: [builtins] Move StringIndexOf to a builtin. (Closed)
Patch Set: Fix signed vs unsigned comparison Created 4 years, 3 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/messages.cc » ('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 b8ab5d4ac52624f9e8af4af2ac59a890c24d1c93..6410ff772b354a022a109a53074aba6d2428ce54 100644
--- a/src/js/string.js
+++ b/src/js/string.js
@@ -44,21 +44,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");
@@ -673,7 +658,6 @@ utils.InstallFunctions(GlobalString.prototype, DONT_ENUM, [
"concat", StringConcat,
"endsWith", StringEndsWith,
"includes", StringIncludes,
- "indexOf", StringIndexOf,
"match", StringMatchJS,
"repeat", StringRepeat,
"replace", StringReplace,
@@ -708,7 +692,6 @@ utils.InstallFunctions(GlobalString.prototype, DONT_ENUM, [
utils.Export(function(to) {
to.ExpandReplacement = ExpandReplacement;
- to.StringIndexOf = StringIndexOf;
to.StringMatch = StringMatchJS;
to.StringReplace = StringReplace;
to.StringSlice = StringSlice;
« no previous file with comments | « src/js/i18n.js ('k') | src/messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698