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

Unified Diff: src/js/string.js

Issue 2373493002: [stubs] Port String.prototype.substr to TurboFan (Closed)
Patch Set: Additional tests 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') | test/mjsunit/substr.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 b5d3eef3852f25a7258086ec03eb7447c7650d11..7c552a93a97026bbcdf57fbd79fda017e7a9eea2 100644
--- a/src/js/string.js
+++ b/src/js/string.js
@@ -237,21 +237,6 @@ function StringSplitJS(separator, limit) {
return %StringSplit(subject, separator_string, limit);
}
-// ecma262/#sec-string.prototype.substr
-function StringSubstr(start, length) {
- CHECK_OBJECT_COERCIBLE(this, "String.prototype.substr");
- var s = TO_STRING(this);
- var size = s.length;
- start = TO_INTEGER(start);
- length = IS_UNDEFINED(length) ? size : TO_INTEGER(length);
-
- if (start < 0) start = MaxSimple(size + start, 0);
- length = MinSimple(MaxSimple(length, 0), size - start);
-
- if (length <= 0) return '';
- return %_SubString(s, start, start + length);
-}
-
// ECMA-262, 15.5.4.16
function StringToLowerCaseJS() {
@@ -557,7 +542,6 @@ utils.InstallFunctions(GlobalString.prototype, DONT_ENUM, [
"search", StringSearch,
"slice", StringSlice,
"split", StringSplitJS,
- "substr", StringSubstr,
"startsWith", StringStartsWith,
"toLowerCase", StringToLowerCaseJS,
"toLocaleLowerCase", StringToLocaleLowerCase,
@@ -588,7 +572,6 @@ utils.Export(function(to) {
to.StringReplace = StringReplace;
to.StringSlice = StringSlice;
to.StringSplit = StringSplitJS;
- to.StringSubstr = StringSubstr;
});
})
« no previous file with comments | « src/js/i18n.js ('k') | test/mjsunit/substr.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698