From 3fd288e3ad80fb290aab3b7402080d360c75dd04 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Thu, 13 Jul 2023 22:32:21 +0800 Subject: [PATCH] Revert "[HACKFIX] workaround for getting 'Error: No such property on self-hosted object: "get format"' after intl updates" This reverts commit 6917ca052b063c9c3ea35c092a95ae48a1527d86. --- toolkit/mozapps/downloads/DownloadUtils.jsm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/toolkit/mozapps/downloads/DownloadUtils.jsm b/toolkit/mozapps/downloads/DownloadUtils.jsm index 60fc6e0285..df74b4605f 100644 --- a/toolkit/mozapps/downloads/DownloadUtils.jsm +++ b/toolkit/mozapps/downloads/DownloadUtils.jsm @@ -497,16 +497,14 @@ this.DownloadUtils = { // Don't try to format Infinity values using NumberFormat. if (aBytes === Infinity) { aBytes = "Infinity"; + } else if (typeof Intl != "undefined") { + aBytes = getLocaleNumberFormat(fractionDigits) + .format(aBytes); } else { - try { - aBytes = getLocaleNumberFormat(fractionDigits) - .format(aBytes); - } catch(e) { - // FIXME: Fall back to the old hack, will be fixed in bug 1200494. - aBytes = aBytes.toFixed(fractionDigits); - if (gDecimalSymbol != ".") { - aBytes = aBytes.replace(".", gDecimalSymbol); - } + // FIXME: Fall back to the old hack, will be fixed in bug 1200494. + aBytes = aBytes.toFixed(fractionDigits); + if (gDecimalSymbol != ".") { + aBytes = aBytes.replace(".", gDecimalSymbol); } }