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

Unified Diff: src/js/string.js

Issue 2023753002: Revert of [builtins] Also migrate String.prototype.toLowerCase/toUpperCase to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@StringTrim
Patch Set: Created 4 years, 7 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 cd1bcdbc29216d5526974ef4b4e78b96b5aa34b8..33a3e72143ca5020c8a9441d6a9b08f63c581f04 100644
--- a/src/js/string.js
+++ b/src/js/string.js
@@ -487,6 +487,38 @@
}
+// ECMA-262, 15.5.4.16
+function StringToLowerCaseJS() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLowerCase");
+
+ return %StringToLowerCase(TO_STRING(this));
+}
+
+
+// ECMA-262, 15.5.4.17
+function StringToLocaleLowerCase() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleLowerCase");
+
+ return %StringToLowerCase(TO_STRING(this));
+}
+
+
+// ECMA-262, 15.5.4.18
+function StringToUpperCaseJS() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.toUpperCase");
+
+ return %StringToUpperCase(TO_STRING(this));
+}
+
+
+// ECMA-262, 15.5.4.19
+function StringToLocaleUpperCase() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleUpperCase");
+
+ return %StringToUpperCase(TO_STRING(this));
+}
+
+
// ES6 draft, revision 26 (2014-07-18), section B.2.3.2.1
function HtmlEscape(str) {
return %_Call(StringReplace, TO_STRING(str), /"/g, """);
@@ -795,6 +827,10 @@
"substring", StringSubstring,
"substr", StringSubstr,
"startsWith", StringStartsWith,
+ "toLowerCase", StringToLowerCaseJS,
+ "toLocaleLowerCase", StringToLocaleLowerCase,
+ "toUpperCase", StringToUpperCaseJS,
+ "toLocaleUpperCase", StringToLocaleUpperCase,
"link", StringLink,
"anchor", StringAnchor,
« 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