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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // ECMA-262 section 15.5.4.9 | 163 // ECMA-262 section 15.5.4.9 |
164 // | 164 // |
165 // This function is implementation specific. For now, we do not | 165 // This function is implementation specific. For now, we do not |
166 // do anything locale specific. | 166 // do anything locale specific. |
167 function StringLocaleCompare(other) { | 167 function StringLocaleCompare(other) { |
168 if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { | 168 if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { |
169 throw MakeTypeError("called_on_null_or_undefined", | 169 throw MakeTypeError("called_on_null_or_undefined", |
170 ["String.prototype.localeCompare"]); | 170 ["String.prototype.localeCompare"]); |
171 } | 171 } |
172 if (%_ArgumentsLength() === 0) return 0; | 172 if (%_ArgumentsLength() === 0) return 0; |
173 return %StringLocaleCompare(TO_STRING_INLINE(this), | 173 return %StringLocaleCompare(TO_STRING_INLINE(this), |
174 TO_STRING_INLINE(other)); | 174 TO_STRING_INLINE(other)); |
175 } | 175 } |
176 | 176 |
177 | 177 |
178 // ECMA-262 section 15.5.4.10 | 178 // ECMA-262 section 15.5.4.10 |
179 function StringMatch(regexp) { | 179 function StringMatch(regexp) { |
180 if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { | 180 if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { |
181 throw MakeTypeError("called_on_null_or_undefined", | 181 throw MakeTypeError("called_on_null_or_undefined", |
182 ["String.prototype.match"]); | 182 ["String.prototype.match"]); |
183 } | 183 } |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 "italics", StringItalics, | 990 "italics", StringItalics, |
991 "small", StringSmall, | 991 "small", StringSmall, |
992 "strike", StringStrike, | 992 "strike", StringStrike, |
993 "sub", StringSub, | 993 "sub", StringSub, |
994 "sup", StringSup | 994 "sup", StringSup |
995 )); | 995 )); |
996 } | 996 } |
997 | 997 |
998 | 998 |
999 SetupString(); | 999 SetupString(); |
OLD | NEW |