commit bb675ac04ace1ff887f5719187a26fac940f3b82
parent 40707c00d7669bd12c0020a9902ab8790dcfde43
Author: Henri Sivonen <hsivonen@hsivonen.fi>
Date: Fri, 12 Dec 2025 16:48:05 +0000
Bug 2005174 - Tweak warning wording for "islamic" fallback to "islamic-tbla". r=anba,dminor
Differential Revision: https://phabricator.services.mozilla.com/D275784
Diffstat:
4 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/js/public/friend/ErrorNumbers.msg b/js/public/friend/ErrorNumbers.msg
@@ -653,7 +653,7 @@ MSG_DEF(JSMSG_INTL_DURATION_INVALID_DISPLAY_OPTION, 1, JSEXN_RANGEERR, "{0} can'
MSG_DEF(JSMSG_INTL_DURATION_INVALID_DISPLAY_OPTION_DEFAULT_STYLE, 1, JSEXN_RANGEERR, "{0} can't use \"always\" display when style defaults to \"numeric\"")
MSG_DEF(JSMSG_INTL_DURATION_INVALID_DISPLAY_OPTION_DEFAULT_DISPLAY, 1, JSEXN_RANGEERR, "{0} can't use \"numeric\" style when display defaults to \"always\"")
MSG_DEF(JSMSG_INVALID_FORMAT_OPTIONS, 1, JSEXN_TYPEERR, "can't format {0} using the requested options")
-MSG_DEF(JSMSG_DEPRECATED_CALENDAR, 1, JSEXN_WARN, "\"{0}\" is deprecated, use \"islamic-tbla\" instead")
+MSG_DEF(JSMSG_ISLAMIC_FALLBACK, 0, JSEXN_WARN, "\"islamic\" does not specify the calendar variant. \"islamic-tbla\" was used. Please specify one of \"islamic-umalqura\", \"islamic-tbla\", or \"islamic-civil\" explicitly.")
// RegExp
MSG_DEF(JSMSG_BAD_CLASS_RANGE, 0, JSEXN_SYNTAXERR, "invalid range in character class")
diff --git a/js/src/builtin/intl/DateTimeFormat.js b/js/src/builtin/intl/DateTimeFormat.js
@@ -73,11 +73,16 @@ function resolveDateTimeFormatInternals(lazyDateTimeFormatData) {
// Changes from "Intl era and monthCode" proposal.
//
// https://tc39.es/proposal-intl-era-monthcode/#sec-createdatetimeformat
- if (r.ca === "islamic" || r.ca === "islamic-rgsa") {
- ReportWarning(JSMSG_DEPRECATED_CALENDAR, r.ca);
+ if (r.ca === "islamic") {
+ ReportWarning(JSMSG_ISLAMIC_FALLBACK);
// Fallback to "islamic-tbla" calendar.
r.ca = "islamic-tbla";
+ } else if (r.ca === "islamic-rgsa") {
+ // Fallback to "islamic-tbla" calendar for 147 uplift compatibility.
+ // The above warning text isn't suitable, and per 2025-12 TG2 meeting
+ // treatment as unknown is expected going forward (bug 2005702).
+ r.ca = "islamic-tbla";
}
// Steps 19-22.
diff --git a/js/src/builtin/intl/DisplayNames.js b/js/src/builtin/intl/DisplayNames.js
@@ -76,16 +76,7 @@ function resolveDisplayNamesInternals(lazyDisplayNamesData) {
}
if (mozExtensions) {
- // Changes from "Intl era and monthCode" proposal.
- //
- // https://tc39.es/proposal-intl-era-monthcode/#sec-createdatetimeformat
- if (r.ca === "islamic" || r.ca === "islamic-rgsa") {
- ReportWarning(JSMSG_DEPRECATED_CALENDAR, r.ca);
-
- // Fallback to "islamic-tbla" calendar.
- r.ca = "islamic-tbla";
- }
-
+ // Note that special casing applies in DateTimeFormat.
internalProps.calendar = r.ca;
}
diff --git a/js/src/tests/non262/Intl/DateTimeFormat/report-warning-for-deprecated-islamic.js b/js/src/tests/non262/Intl/DateTimeFormat/report-warning-for-deprecated-islamic.js
@@ -6,7 +6,6 @@ const locales = [
const deprecated = [
"islamic",
- "islamic-rgsa"
];
const supportedCalendars = Intl.supportedValuesOf("calendar");