OLD | NEW |
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // otherwise we call the runtime system. | 173 // otherwise we call the runtime system. |
174 function SubString(string, start, end) { | 174 function SubString(string, start, end) { |
175 // Use the one character string cache. | 175 // Use the one character string cache. |
176 if (start + 1 == end) { | 176 if (start + 1 == end) { |
177 var char_code = %_FastCharCodeAt(string, start); | 177 var char_code = %_FastCharCodeAt(string, start); |
178 if (!%_IsSmi(char_code)) { | 178 if (!%_IsSmi(char_code)) { |
179 char_code = %StringCharCodeAt(string, start); | 179 char_code = %StringCharCodeAt(string, start); |
180 } | 180 } |
181 return %CharFromCode(char_code); | 181 return %CharFromCode(char_code); |
182 } | 182 } |
183 return %SubString(string, start, end); | 183 return %_SubString(string, start, end); |
184 } | 184 } |
185 | 185 |
186 | 186 |
187 // This has the same size as the lastMatchInfo array, and can be used for | 187 // This has the same size as the lastMatchInfo array, and can be used for |
188 // functions that expect that structure to be returned. It is used when the | 188 // functions that expect that structure to be returned. It is used when the |
189 // needle is a string rather than a regexp. In this case we can't update | 189 // needle is a string rather than a regexp. In this case we can't update |
190 // lastMatchArray without erroneously affecting the properties on the global | 190 // lastMatchArray without erroneously affecting the properties on the global |
191 // RegExp object. | 191 // RegExp object. |
192 var reusableMatchInfo = [2, "", "", -1, -1]; | 192 var reusableMatchInfo = [2, "", "", -1, -1]; |
193 | 193 |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 "small", StringSmall, | 889 "small", StringSmall, |
890 "strike", StringStrike, | 890 "strike", StringStrike, |
891 "sub", StringSub, | 891 "sub", StringSub, |
892 "sup", StringSup, | 892 "sup", StringSup, |
893 "toJSON", StringToJSON | 893 "toJSON", StringToJSON |
894 )); | 894 )); |
895 } | 895 } |
896 | 896 |
897 | 897 |
898 SetupString(); | 898 SetupString(); |
OLD | NEW |