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

Side by Side Diff: src/js/i18n.js

Issue 2639333003: [intl] Check for duplicate BCP 47 tags in a case-insensitive way (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | test/test262/local-tests/test/intl402/6.2.2_b.js » ('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 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
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
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 })
OLDNEW
« no previous file with comments | « no previous file | test/test262/local-tests/test/intl402/6.2.2_b.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698