Bug 1211255 - fix downloads on fennec, r=mak
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 05 Oct 2015 13:55:22 +0100
changeset 266233 9c7b4822185326e62ddde4b4db3019ea9a4a5502
parent 266232 09584f83e610683714e8eae857733b9c32e13be5
child 266234 2ebf10394882ffc825ab01d6ff54497d773808ae
push id15537
push usergijskruitbosch@gmail.com
push dateTue, 06 Oct 2015 13:49:00 +0000
treeherderfx-team@9c7b48221853 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1211255
milestone44.0a1
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);
       }
     }