OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 // ECMAScript 402 API implementation. | 5 // ECMAScript 402 API implementation. |
6 | 6 |
7 /** | 7 /** |
8 * Intl object is a single object that has some named properties, | 8 * Intl object is a single object that has some named properties, |
9 * all of which are constructors. | 9 * all of which are constructors. |
10 */ | 10 */ |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 * hant-cmn-cn, through. | 844 * hant-cmn-cn, through. |
845 * | 845 * |
846 * Returns false if the language tag is invalid. | 846 * Returns false if the language tag is invalid. |
847 */ | 847 */ |
848 function isStructuallyValidLanguageTag(locale) { | 848 function isStructuallyValidLanguageTag(locale) { |
849 // Check if it's well-formed, including grandfadered tags. | 849 // Check if it's well-formed, including grandfadered tags. |
850 if (IS_NULL(%regexp_internal_match(GetLanguageTagRE(), locale))) { | 850 if (IS_NULL(%regexp_internal_match(GetLanguageTagRE(), locale))) { |
851 return false; | 851 return false; |
852 } | 852 } |
853 | 853 |
| 854 locale = %StringToLowerCase(locale); |
| 855 |
854 // Just return if it's a x- form. It's all private. | 856 // Just return if it's a x- form. It's all private. |
855 if (%StringIndexOf(locale, 'x-', 0) === 0) { | 857 if (%StringIndexOf(locale, 'x-', 0) === 0) { |
856 return true; | 858 return true; |
857 } | 859 } |
858 | 860 |
859 // Check if there are any duplicate variants or singletons (extensions). | 861 // Check if there are any duplicate variants or singletons (extensions). |
860 | 862 |
861 // Remove private use section. | 863 // Remove private use section. |
862 locale = %StringSplit(locale, '-x-', kMaxUint32)[0]; | 864 locale = %StringSplit(locale, '-x-', kMaxUint32)[0]; |
863 | 865 |
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 } | 2168 } |
2167 ); | 2169 ); |
2168 | 2170 |
2169 %FunctionRemovePrototype(FormatDateToParts); | 2171 %FunctionRemovePrototype(FormatDateToParts); |
2170 | 2172 |
2171 utils.Export(function(to) { | 2173 utils.Export(function(to) { |
2172 to.FormatDateToParts = FormatDateToParts; | 2174 to.FormatDateToParts = FormatDateToParts; |
2173 }); | 2175 }); |
2174 | 2176 |
2175 }) | 2177 }) |
OLD | NEW |