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

Side by Side Diff: src/string.js

Issue 1725002: Port bugfix in revision 4449 to 2.1 branch. (Closed)
Patch Set: Changed minor version too. Created 10 years, 8 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/runtime.cc ('k') | src/version.cc » ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 str = TO_STRING_INLINE(str); 905 str = TO_STRING_INLINE(str);
906 if (str.length > 0) { 906 if (str.length > 0) {
907 var elements = this.elements; 907 var elements = this.elements;
908 elements[elements.length] = str; 908 elements[elements.length] = str;
909 } 909 }
910 } 910 }
911 911
912 912
913 ReplaceResultBuilder.prototype.addSpecialSlice = function(start, end) { 913 ReplaceResultBuilder.prototype.addSpecialSlice = function(start, end) {
914 var len = end - start; 914 var len = end - start;
915 if (len == 0) return; 915 if (start < 0 || len <= 0) return;
916 var elements = this.elements; 916 var elements = this.elements;
917 if (start < 0x80000 && len < 0x800) { 917 if (start < 0x80000 && len < 0x800) {
918 elements[elements.length] = (start << 11) + len; 918 elements[elements.length] = (start << 11) | len;
919 } else { 919 } else {
920 // 0 < len <= String::kMaxLength and Smi::kMaxValue >= String::kMaxLength, 920 // 0 < len <= String::kMaxLength and Smi::kMaxValue >= String::kMaxLength,
921 // so -len is a smi. 921 // so -len is a smi.
922 elements[elements.length] = -len; 922 elements[elements.length] = -len;
923 elements[elements.length] = start; 923 elements[elements.length] = start;
924 } 924 }
925 } 925 }
926 926
927 927
928 ReplaceResultBuilder.prototype.generate = function() { 928 ReplaceResultBuilder.prototype.generate = function() {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 "small", StringSmall, 985 "small", StringSmall,
986 "strike", StringStrike, 986 "strike", StringStrike,
987 "sub", StringSub, 987 "sub", StringSub,
988 "sup", StringSup, 988 "sup", StringSup,
989 "toJSON", StringToJSON 989 "toJSON", StringToJSON
990 )); 990 ));
991 } 991 }
992 992
993 993
994 SetupString(); 994 SetupString();
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698