Bug 720984 - contentAreaUtils.js: getTargetFile leaks gDownloadLastDir into the global scope. r=gavin

--HG--
extra : rebase_source : 7c6959f7e854c34262acddd3e1a174ce165abf39
This commit is contained in:
Dão Gottwald 2012-01-26 10:57:47 +01:00
parent 2831e60f32
commit 7613908f1c

View File

@ -563,8 +563,9 @@ function initFileInfo(aFI, aURL, aURLCharset, aDocument,
*/
function getTargetFile(aFpP, /* optional */ aSkipPrompt, /* optional */ aRelatedURI)
{
if (typeof gDownloadLastDir != "object")
Components.utils.import("resource://gre/modules/DownloadLastDir.jsm");
if (!getTargetFile.gDownloadLastDir)
Components.utils.import("resource://gre/modules/DownloadLastDir.jsm", getTargetFile);
var gDownloadLastDir = getTargetFile.gDownloadLastDir;
var prefs = getPrefsBrowserDownload("browser.download.");
var useDownloadDir = prefs.getBoolPref("useDownloadDir");