| 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 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1744 } | 1744 } |
| 1745 | 1745 |
| 1746 if (!NUMBER_IS_FINITE(dateMs)) throw %make_range_error(kDateRange); | 1746 if (!NUMBER_IS_FINITE(dateMs)) throw %make_range_error(kDateRange); |
| 1747 | 1747 |
| 1748 return %InternalDateFormatToParts(this, new GlobalDate(dateMs)); | 1748 return %InternalDateFormatToParts(this, new GlobalDate(dateMs)); |
| 1749 } | 1749 } |
| 1750 | 1750 |
| 1751 %FunctionSetLength(FormatDateToParts, 0); | 1751 %FunctionSetLength(FormatDateToParts, 0); |
| 1752 | 1752 |
| 1753 | 1753 |
| 1754 // 0 because date is optional argument. | 1754 // Length is 1 as specified in ECMA 402 v2+ |
| 1755 AddBoundMethod(GlobalIntlDateTimeFormat, 'format', formatDate, 0, 'dateformat', | 1755 AddBoundMethod(GlobalIntlDateTimeFormat, 'format', formatDate, 1, 'dateformat', |
| 1756 true); | 1756 true); |
| 1757 | 1757 |
| 1758 | 1758 |
| 1759 /** | 1759 /** |
| 1760 * Returns canonical Area/Location(/Location) name, or throws an exception | 1760 * Returns canonical Area/Location(/Location) name, or throws an exception |
| 1761 * if the zone name is invalid IANA name. | 1761 * if the zone name is invalid IANA name. |
| 1762 */ | 1762 */ |
| 1763 function canonicalizeTimeZoneID(tzID) { | 1763 function canonicalizeTimeZoneID(tzID) { |
| 1764 // Skip undefined zones. | 1764 // Skip undefined zones. |
| 1765 if (IS_UNDEFINED(tzID)) { | 1765 if (IS_UNDEFINED(tzID)) { |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2173 | 2173 |
| 2174 utils.Export(function(to) { | 2174 utils.Export(function(to) { |
| 2175 to.FormatDateToParts = FormatDateToParts; | 2175 to.FormatDateToParts = FormatDateToParts; |
| 2176 to.ToLowerCaseI18N = ToLowerCaseI18N; | 2176 to.ToLowerCaseI18N = ToLowerCaseI18N; |
| 2177 to.ToUpperCaseI18N = ToUpperCaseI18N; | 2177 to.ToUpperCaseI18N = ToUpperCaseI18N; |
| 2178 to.ToLocaleLowerCaseI18N = ToLocaleLowerCaseI18N; | 2178 to.ToLocaleLowerCaseI18N = ToLocaleLowerCaseI18N; |
| 2179 to.ToLocaleUpperCaseI18N = ToLocaleUpperCaseI18N; | 2179 to.ToLocaleUpperCaseI18N = ToLocaleUpperCaseI18N; |
| 2180 }); | 2180 }); |
| 2181 | 2181 |
| 2182 }) | 2182 }) |
| OLD | NEW |