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 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 var mnfd = options['minimumFractionDigits']; | 1108 var mnfd = options['minimumFractionDigits']; |
1109 var mxfd = options['maximumFractionDigits']; | 1109 var mxfd = options['maximumFractionDigits']; |
1110 if (!IS_UNDEFINED(mnfd) || internalOptions.style !== 'currency') { | 1110 if (!IS_UNDEFINED(mnfd) || internalOptions.style !== 'currency') { |
1111 mnfd = getNumberOption(options, 'minimumFractionDigits', 0, 20, 0); | 1111 mnfd = getNumberOption(options, 'minimumFractionDigits', 0, 20, 0); |
1112 defineWEProperty(internalOptions, 'minimumFractionDigits', mnfd); | 1112 defineWEProperty(internalOptions, 'minimumFractionDigits', mnfd); |
1113 } | 1113 } |
1114 | 1114 |
1115 if (!IS_UNDEFINED(mxfd) || internalOptions.style !== 'currency') { | 1115 if (!IS_UNDEFINED(mxfd) || internalOptions.style !== 'currency') { |
1116 var min_mxfd = internalOptions.style === 'percent' ? 0 : 3; | 1116 var min_mxfd = internalOptions.style === 'percent' ? 0 : 3; |
1117 mnfd = IS_UNDEFINED(mnfd) ? 0 : mnfd; | 1117 mnfd = IS_UNDEFINED(mnfd) ? 0 : mnfd; |
1118 fallback_limit = (mnfd > min_mxfd) ? mnfd : min_mxfd; | 1118 var fallback_limit = (mnfd > min_mxfd) ? mnfd : min_mxfd; |
1119 mxfd = getNumberOption(options, 'maximumFractionDigits', mnfd, 20, fallback_
limit); | 1119 mxfd = getNumberOption(options, 'maximumFractionDigits', mnfd, 20, fallback_
limit); |
1120 defineWEProperty(internalOptions, 'maximumFractionDigits', mxfd); | 1120 defineWEProperty(internalOptions, 'maximumFractionDigits', mxfd); |
1121 } | 1121 } |
1122 | 1122 |
1123 var mnsd = options['minimumSignificantDigits']; | 1123 var mnsd = options['minimumSignificantDigits']; |
1124 var mxsd = options['maximumSignificantDigits']; | 1124 var mxsd = options['maximumSignificantDigits']; |
1125 if (!IS_UNDEFINED(mnsd) || !IS_UNDEFINED(mxsd)) { | 1125 if (!IS_UNDEFINED(mnsd) || !IS_UNDEFINED(mxsd)) { |
1126 mnsd = getNumberOption(options, 'minimumSignificantDigits', 1, 21, 0); | 1126 mnsd = getNumberOption(options, 'minimumSignificantDigits', 1, 21, 0); |
1127 defineWEProperty(internalOptions, 'minimumSignificantDigits', mnsd); | 1127 defineWEProperty(internalOptions, 'minimumSignificantDigits', mnsd); |
1128 | 1128 |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2116 } | 2116 } |
2117 | 2117 |
2118 var locales = %_Arguments(0); | 2118 var locales = %_Arguments(0); |
2119 var options = %_Arguments(1); | 2119 var options = %_Arguments(1); |
2120 return toLocaleDateTime( | 2120 return toLocaleDateTime( |
2121 this, locales, options, 'time', 'time', 'dateformattime'); | 2121 this, locales, options, 'time', 'time', 'dateformattime'); |
2122 } | 2122 } |
2123 ); | 2123 ); |
2124 | 2124 |
2125 }) | 2125 }) |
OLD | NEW |