diff options
author | Martok <martok@martoks-place.de> | 2023-06-04 16:47:15 +0200 |
---|---|---|
committer | Martok <martok@martoks-place.de> | 2023-06-29 22:18:07 +0200 |
commit | 1ec5d757e64c86b45145d8a388d4befb74810776 (patch) | |
tree | 8077e4bef6bf45b9a2168d164f6eea8ed2e6e98e /js | |
parent | a666c05d6892da00876aed31dd6b5fd0ab5f86d3 (diff) | |
download | uxp-1ec5d757e64c86b45145d8a388d4befb74810776.tar.gz |
Issue #1969 Follow-Up: Error reporting arguments in RelativeTimeFormat/DateTimeFormat
Diffstat (limited to 'js')
-rw-r--r-- | js/src/builtin/intl/DateTimeFormat.cpp | 6 | ||||
-rw-r--r-- | js/src/builtin/intl/RelativeTimeFormat.js | 2 | ||||
-rw-r--r-- | js/src/js.msg | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/js/src/builtin/intl/DateTimeFormat.cpp b/js/src/builtin/intl/DateTimeFormat.cpp index 2ac50897fe..5aa8e0d7a2 100644 --- a/js/src/builtin/intl/DateTimeFormat.cpp +++ b/js/src/builtin/intl/DateTimeFormat.cpp @@ -558,7 +558,8 @@ static bool intl_FormatDateTime(JSContext* cx, UDateFormat* df, double x, MutableHandleValue result)
{
if (!IsFinite(x)) {
- JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_DATE_NOT_FINITE);
+ JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_DATE_NOT_FINITE,
+ "DateTimeFormat", "format");
return false;
}
@@ -664,7 +665,8 @@ static bool intl_FormatToPartsDateTime(JSContext* cx, UDateFormat* df, double x, MutableHandleValue result)
{
if (!IsFinite(x)) {
- JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_DATE_NOT_FINITE);
+ JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_DATE_NOT_FINITE,
+ "DateTimeFormat", "formatToParts");
return false;
}
diff --git a/js/src/builtin/intl/RelativeTimeFormat.js b/js/src/builtin/intl/RelativeTimeFormat.js index 7cb8d3b083..1118df9025 100644 --- a/js/src/builtin/intl/RelativeTimeFormat.js +++ b/js/src/builtin/intl/RelativeTimeFormat.js @@ -191,7 +191,7 @@ function Intl_RelativeTimeFormat_format(value, unit) { // PartitionRelativeTimePattern, step 4.
if (!Number_isFinite(t)) {
- ThrowRangeError(JSMSG_DATE_NOT_FINITE, "RelativeTimeFormat");
+ ThrowRangeError(JSMSG_DATE_NOT_FINITE, "RelativeTimeFormat", "format");
}
// PartitionRelativeTimePattern, step 5.
diff --git a/js/src/js.msg b/js/src/js.msg index 91637edc6a..fe69fba60c 100644 --- a/js/src/js.msg +++ b/js/src/js.msg @@ -484,7 +484,7 @@ MSG_DEF(JSMSG_DEBUG_PROMISE_NOT_REJECTED, 0, JSEXN_TYPEERR, "Promise hasn't been MSG_DEF(JSMSG_TRACELOGGER_ENABLE_FAIL, 1, JSEXN_ERR, "enabling tracelogger failed: {0}") // Intl -MSG_DEF(JSMSG_DATE_NOT_FINITE, 0, JSEXN_RANGEERR, "date value is not finite in DateTimeFormat.format()") +MSG_DEF(JSMSG_DATE_NOT_FINITE, 2, JSEXN_RANGEERR, "date value is not finite in {0}.{1}()") MSG_DEF(JSMSG_INTERNAL_INTL_ERROR, 0, JSEXN_ERR, "internal error while computing Intl data") MSG_DEF(JSMSG_INTL_OBJECT_NOT_INITED, 3, JSEXN_TYPEERR, "Intl.{0}.prototype.{1} called on value that's not an object initialized as a {2}") MSG_DEF(JSMSG_INTL_OBJECT_REINITED, 0, JSEXN_TYPEERR, "can't initialize object twice as an object of an Intl constructor") |