mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-28 01:57:30 +09:00
[HACKFIX] workaround for getting 'Error: No such property on self-hosted object: "get format"' after intl updates
This commit is contained in:
parent
9f1550fb53
commit
6917ca052b
1 changed files with 9 additions and 7 deletions
|
|
@ -497,16 +497,18 @@ this.DownloadUtils = {
|
||||||
// Don't try to format Infinity values using NumberFormat.
|
// Don't try to format Infinity values using NumberFormat.
|
||||||
if (aBytes === Infinity) {
|
if (aBytes === Infinity) {
|
||||||
aBytes = "Infinity";
|
aBytes = "Infinity";
|
||||||
} else if (typeof Intl != "undefined") {
|
} else {
|
||||||
|
try {
|
||||||
aBytes = getLocaleNumberFormat(fractionDigits)
|
aBytes = getLocaleNumberFormat(fractionDigits)
|
||||||
.format(aBytes);
|
.format(aBytes);
|
||||||
} else {
|
} catch(e) {
|
||||||
// FIXME: Fall back to the old hack, will be fixed in bug 1200494.
|
// FIXME: Fall back to the old hack, will be fixed in bug 1200494.
|
||||||
aBytes = aBytes.toFixed(fractionDigits);
|
aBytes = aBytes.toFixed(fractionDigits);
|
||||||
if (gDecimalSymbol != ".") {
|
if (gDecimalSymbol != ".") {
|
||||||
aBytes = aBytes.replace(".", gDecimalSymbol);
|
aBytes = aBytes.replace(".", gDecimalSymbol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return [aBytes, gBundle.GetStringFromName(gStr.units[unitIndex])];
|
return [aBytes, gBundle.GetStringFromName(gStr.units[unitIndex])];
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue