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

Side by Side Diff: src/i18n.js

Issue 1430733002: Version 4.6.85.31 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.6
Patch Set: Created 5 years, 1 month 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 | « include/v8-version.h ('k') | test/intl/number-format/check-minimum-fraction-digits.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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 defineWEProperty(internalOptions, 'currency', %StringToUpperCase(currency)); 1096 defineWEProperty(internalOptions, 'currency', %StringToUpperCase(currency));
1097 defineWEProperty(internalOptions, 'currencyDisplay', currencyDisplay); 1097 defineWEProperty(internalOptions, 'currencyDisplay', currencyDisplay);
1098 } 1098 }
1099 1099
1100 // Digit ranges. 1100 // Digit ranges.
1101 var mnid = getNumberOption(options, 'minimumIntegerDigits', 1, 21, 1); 1101 var mnid = getNumberOption(options, 'minimumIntegerDigits', 1, 21, 1);
1102 defineWEProperty(internalOptions, 'minimumIntegerDigits', mnid); 1102 defineWEProperty(internalOptions, 'minimumIntegerDigits', mnid);
1103 1103
1104 var mnfd = options['minimumFractionDigits']; 1104 var mnfd = options['minimumFractionDigits'];
1105 var mxfd = options['maximumFractionDigits']; 1105 var mxfd = options['maximumFractionDigits'];
1106 if (!IS_UNDEFINED(mnfd) || !internalOptions.style === 'currency') { 1106 if (!IS_UNDEFINED(mnfd) || internalOptions.style !== 'currency') {
1107 mnfd = getNumberOption(options, 'minimumFractionDigits', 0, 20, 0); 1107 mnfd = getNumberOption(options, 'minimumFractionDigits', 0, 20, 0);
1108 defineWEProperty(internalOptions, 'minimumFractionDigits', mnfd); 1108 defineWEProperty(internalOptions, 'minimumFractionDigits', mnfd);
1109 } 1109 }
1110 1110
1111 if (!IS_UNDEFINED(mxfd) || !internalOptions.style === 'currency') { 1111 if (!IS_UNDEFINED(mxfd) || internalOptions.style !== 'currency') {
1112 var min_mxfd = internalOptions.style === 'percent' ? 0 : 3;
1112 mnfd = IS_UNDEFINED(mnfd) ? 0 : mnfd; 1113 mnfd = IS_UNDEFINED(mnfd) ? 0 : mnfd;
1113 fallback_limit = (mnfd > 3) ? mnfd : 3; 1114 fallback_limit = (mnfd > min_mxfd) ? mnfd : min_mxfd;
1114 mxfd = getNumberOption(options, 'maximumFractionDigits', mnfd, 20, fallback_ limit); 1115 mxfd = getNumberOption(options, 'maximumFractionDigits', mnfd, 20, fallback_ limit);
1115 defineWEProperty(internalOptions, 'maximumFractionDigits', mxfd); 1116 defineWEProperty(internalOptions, 'maximumFractionDigits', mxfd);
1116 } 1117 }
1117 1118
1118 var mnsd = options['minimumSignificantDigits']; 1119 var mnsd = options['minimumSignificantDigits'];
1119 var mxsd = options['maximumSignificantDigits']; 1120 var mxsd = options['maximumSignificantDigits'];
1120 if (!IS_UNDEFINED(mnsd) || !IS_UNDEFINED(mxsd)) { 1121 if (!IS_UNDEFINED(mnsd) || !IS_UNDEFINED(mxsd)) {
1121 mnsd = getNumberOption(options, 'minimumSignificantDigits', 1, 21, 0); 1122 mnsd = getNumberOption(options, 'minimumSignificantDigits', 1, 21, 0);
1122 defineWEProperty(internalOptions, 'minimumSignificantDigits', mnsd); 1123 defineWEProperty(internalOptions, 'minimumSignificantDigits', mnsd);
1123 1124
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 } 2112 }
2112 2113
2113 var locales = %_Arguments(0); 2114 var locales = %_Arguments(0);
2114 var options = %_Arguments(1); 2115 var options = %_Arguments(1);
2115 return toLocaleDateTime( 2116 return toLocaleDateTime(
2116 this, locales, options, 'time', 'time', 'dateformattime'); 2117 this, locales, options, 'time', 'time', 'dateformattime');
2117 } 2118 }
2118 ); 2119 );
2119 2120
2120 }) 2121 })
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | test/intl/number-format/check-minimum-fraction-digits.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698