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

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

Issue 2143003005: [i18n] Ensure [[ToString]] conversion of time zone names. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/mjsunit/regress/regress-crbug-627935.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 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after
1778 /** 1778 /**
1779 * Returns canonical Area/Location(/Location) name, or throws an exception 1779 * Returns canonical Area/Location(/Location) name, or throws an exception
1780 * if the zone name is invalid IANA name. 1780 * if the zone name is invalid IANA name.
1781 */ 1781 */
1782 function canonicalizeTimeZoneID(tzID) { 1782 function canonicalizeTimeZoneID(tzID) {
1783 // Skip undefined zones. 1783 // Skip undefined zones.
1784 if (IS_UNDEFINED(tzID)) { 1784 if (IS_UNDEFINED(tzID)) {
1785 return tzID; 1785 return tzID;
1786 } 1786 }
1787 1787
1788 // Convert zone name to string.
1789 tzID = TO_STRING(tzID);
1790
1788 // Special case handling (UTC, GMT). 1791 // Special case handling (UTC, GMT).
1789 var upperID = %StringToUpperCase(tzID); 1792 var upperID = %StringToUpperCase(tzID);
1790 if (upperID === 'UTC' || upperID === 'GMT' || 1793 if (upperID === 'UTC' || upperID === 'GMT' ||
1791 upperID === 'ETC/UTC' || upperID === 'ETC/GMT') { 1794 upperID === 'ETC/UTC' || upperID === 'ETC/GMT') {
1792 return 'UTC'; 1795 return 'UTC';
1793 } 1796 }
1794 1797
1795 // TODO(jshin): Add support for Etc/GMT[+-]([1-9]|1[0-2]) 1798 // TODO(jshin): Add support for Etc/GMT[+-]([1-9]|1[0-2])
1796 1799
1797 // We expect only _, '-' and / beside ASCII letters. 1800 // We expect only _, '-' and / beside ASCII letters.
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2249 } 2252 }
2250 ); 2253 );
2251 2254
2252 utils.Export(function(to) { 2255 utils.Export(function(to) {
2253 to.AddBoundMethod = AddBoundMethod; 2256 to.AddBoundMethod = AddBoundMethod;
2254 to.IntlParseDate = IntlParseDate; 2257 to.IntlParseDate = IntlParseDate;
2255 to.IntlParseNumber = IntlParseNumber; 2258 to.IntlParseNumber = IntlParseNumber;
2256 }); 2259 });
2257 2260
2258 }) 2261 })
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-627935.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698