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

Side by Side 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, 6 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 unified diff | Download patch
« no previous file with comments | « src/js/i18n.js ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils) {
6 6
7 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 } 480 }
481 } 481 }
482 482
483 var end = start + len; 483 var end = start + len;
484 if (end > s.length) end = s.length; 484 if (end > s.length) end = s.length;
485 485
486 return %_SubString(s, start, end); 486 return %_SubString(s, start, end);
487 } 487 }
488 488
489 489
490 // ECMA-262, 15.5.4.16
491 function StringToLowerCaseJS() {
492 CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLowerCase");
493
494 return %StringToLowerCase(TO_STRING(this));
495 }
496
497
498 // ECMA-262, 15.5.4.17
499 function StringToLocaleLowerCase() {
500 CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleLowerCase");
501
502 return %StringToLowerCase(TO_STRING(this));
503 }
504
505
506 // ECMA-262, 15.5.4.18
507 function StringToUpperCaseJS() {
508 CHECK_OBJECT_COERCIBLE(this, "String.prototype.toUpperCase");
509
510 return %StringToUpperCase(TO_STRING(this));
511 }
512
513
514 // ECMA-262, 15.5.4.19
515 function StringToLocaleUpperCase() {
516 CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleUpperCase");
517
518 return %StringToUpperCase(TO_STRING(this));
519 }
520
521
490 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2.1 522 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2.1
491 function HtmlEscape(str) { 523 function HtmlEscape(str) {
492 return %_Call(StringReplace, TO_STRING(str), /"/g, """); 524 return %_Call(StringReplace, TO_STRING(str), /"/g, """);
493 } 525 }
494 526
495 527
496 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2 528 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2
497 function StringAnchor(name) { 529 function StringAnchor(name) {
498 CHECK_OBJECT_COERCIBLE(this, "String.prototype.anchor"); 530 CHECK_OBJECT_COERCIBLE(this, "String.prototype.anchor");
499 return "<a name=\"" + HtmlEscape(name) + "\">" + TO_STRING(this) + 531 return "<a name=\"" + HtmlEscape(name) + "\">" + TO_STRING(this) +
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 "match", StringMatchJS, 820 "match", StringMatchJS,
789 "normalize", StringNormalize, 821 "normalize", StringNormalize,
790 "repeat", StringRepeat, 822 "repeat", StringRepeat,
791 "replace", StringReplace, 823 "replace", StringReplace,
792 "search", StringSearch, 824 "search", StringSearch,
793 "slice", StringSlice, 825 "slice", StringSlice,
794 "split", StringSplitJS, 826 "split", StringSplitJS,
795 "substring", StringSubstring, 827 "substring", StringSubstring,
796 "substr", StringSubstr, 828 "substr", StringSubstr,
797 "startsWith", StringStartsWith, 829 "startsWith", StringStartsWith,
830 "toLowerCase", StringToLowerCaseJS,
831 "toLocaleLowerCase", StringToLocaleLowerCase,
832 "toUpperCase", StringToUpperCaseJS,
833 "toLocaleUpperCase", StringToLocaleUpperCase,
798 834
799 "link", StringLink, 835 "link", StringLink,
800 "anchor", StringAnchor, 836 "anchor", StringAnchor,
801 "fontcolor", StringFontcolor, 837 "fontcolor", StringFontcolor,
802 "fontsize", StringFontsize, 838 "fontsize", StringFontsize,
803 "big", StringBig, 839 "big", StringBig,
804 "blink", StringBlink, 840 "blink", StringBlink,
805 "bold", StringBold, 841 "bold", StringBold,
806 "fixed", StringFixed, 842 "fixed", StringFixed,
807 "italics", StringItalics, 843 "italics", StringItalics,
(...skipping 12 matching lines...) Expand all
820 to.StringLastIndexOf = StringLastIndexOf; 856 to.StringLastIndexOf = StringLastIndexOf;
821 to.StringMatch = StringMatchJS; 857 to.StringMatch = StringMatchJS;
822 to.StringReplace = StringReplace; 858 to.StringReplace = StringReplace;
823 to.StringSlice = StringSlice; 859 to.StringSlice = StringSlice;
824 to.StringSplit = StringSplitJS; 860 to.StringSplit = StringSplitJS;
825 to.StringSubstr = StringSubstr; 861 to.StringSubstr = StringSubstr;
826 to.StringSubstring = StringSubstring; 862 to.StringSubstring = StringSubstring;
827 }); 863 });
828 864
829 }) 865 })
OLDNEW
« 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