Bug 1211255 - fix downloads on fennec, r=mak
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 05 Oct 2015 13:55:22 +0100
changeset 266274 9c7b4822185326e62ddde4b4db3019ea9a4a5502
parent 266273 09584f83e610683714e8eae857733b9c32e13be5
child 266275 2ebf10394882ffc825ab01d6ff54497d773808ae
push id29485
push userkwierso@gmail.com
push dateTue, 06 Oct 2015 19:07:33 +0000
treeherdermozilla-central@950ca166c10d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1211255
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1211255 - fix downloads on fennec, r=mak
toolkit/mozapps/downloads/DownloadUtils.jsm
--- a/toolkit/mozapps/downloads/DownloadUtils.jsm
+++ b/toolkit/mozapps/downloads/DownloadUtils.jsm
@@ -478,17 +478,17 @@ this.DownloadUtils = {
     // 0 -> 0; 1.2 -> 1.2; 12.3 -> 12.3; 123.4 -> 123; 234.5 -> 235
     // added in bug 462064: (unitIndex != 0) makes sure that no decimal digit for bytes appears when aBytes < 100
     let fractionDigits = (aBytes > 0) && (aBytes < 100) && (unitIndex != 0) ? 1 : 0;
 
     // Don't try to format Infinity values using NumberFormat.
     if (aBytes === Infinity) {
       aBytes = "Infinity";
     } else {
-      if (Intl) {
+      if (typeof Intl != "undefined") {
         aBytes = getLocaleNumberFormat(fractionDigits)
                    .format(aBytes);
       } else if (gDecimalSymbol != ".") {
         // FIXME: Fall back to the old hack, will be fixed in bug 1200494.
         aBytes = aBytes.toFixed(fractionDigits).replace(".", gDecimalSymbol);
       }
     }