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

Unified 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, 2 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/i18n.js
diff --git a/src/i18n.js b/src/i18n.js
index 5fd32c8b407fd7335051f4f76fdc486d9ffd9e60..b825ece6bcde8041b6e6438af30879c5af2b28b1 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -1103,14 +1103,15 @@ function initializeNumberFormat(numberFormat, locales, options) {
var mnfd = options['minimumFractionDigits'];
var mxfd = options['maximumFractionDigits'];
- if (!IS_UNDEFINED(mnfd) || !internalOptions.style === 'currency') {
+ if (!IS_UNDEFINED(mnfd) || internalOptions.style !== 'currency') {
mnfd = getNumberOption(options, 'minimumFractionDigits', 0, 20, 0);
defineWEProperty(internalOptions, 'minimumFractionDigits', mnfd);
}
- if (!IS_UNDEFINED(mxfd) || !internalOptions.style === 'currency') {
+ if (!IS_UNDEFINED(mxfd) || internalOptions.style !== 'currency') {
+ var min_mxfd = internalOptions.style === 'percent' ? 0 : 3;
mnfd = IS_UNDEFINED(mnfd) ? 0 : mnfd;
- fallback_limit = (mnfd > 3) ? mnfd : 3;
+ fallback_limit = (mnfd > min_mxfd) ? mnfd : min_mxfd;
mxfd = getNumberOption(options, 'maximumFractionDigits', mnfd, 20, fallback_limit);
defineWEProperty(internalOptions, 'maximumFractionDigits', mxfd);
}
« 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