Bug 1129321 - Remove nonstandard let blocks from browser. r=ttaubert

This commit is contained in:
Chris Peterson 2015-01-24 23:39:14 -08:00
Родитель 562649fe82
Коммит 6d54bd3f21
7 изменённых файлов: 64 добавлений и 63 удалений

Просмотреть файл

@ -51,25 +51,28 @@ Object.keys(requiredSize).forEach(prop => {
gBrowser.contentWindow[prop] = requiredSize[prop]; gBrowser.contentWindow[prop] = requiredSize[prop];
} }
}); });
let (screenHeight = {}, screenWidth = {}) {
Cc["@mozilla.org/gfx/screenmanager;1"]. let screenHeight = {};
let screenWidth = {};
Cc["@mozilla.org/gfx/screenmanager;1"].
getService(Ci.nsIScreenManager). getService(Ci.nsIScreenManager).
primaryScreen. primaryScreen.
GetAvailRectDisplayPix({}, {}, screenWidth, screenHeight); GetAvailRectDisplayPix({}, {}, screenWidth, screenHeight);
screenHeight = screenHeight.value; screenHeight = screenHeight.value;
screenWidth = screenWidth.value; screenWidth = screenWidth.value;
if (screenHeight < gBrowser.contentWindow.outerHeight) {
if (screenHeight < gBrowser.contentWindow.outerHeight) {
info("Warning: Browser outer height is now " + info("Warning: Browser outer height is now " +
gBrowser.contentWindow.outerHeight + ", which is larger than the " + gBrowser.contentWindow.outerHeight + ", which is larger than the " +
"available screen height, " + screenHeight + "available screen height, " + screenHeight +
". That may cause problems."); ". That may cause problems.");
} }
if (screenWidth < gBrowser.contentWindow.outerWidth) {
if (screenWidth < gBrowser.contentWindow.outerWidth) {
info("Warning: Browser outer width is now " + info("Warning: Browser outer width is now " +
gBrowser.contentWindow.outerWidth + ", which is larger than the " + gBrowser.contentWindow.outerWidth + ", which is larger than the " +
"available screen width, " + screenWidth + "available screen width, " + screenWidth +
". That may cause problems."); ". That may cause problems.");
}
} }
registerCleanupFunction(function () { registerCleanupFunction(function () {

Просмотреть файл

@ -20,7 +20,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "MigrationUtils",
let gProfD = do_get_profile(); let gProfD = do_get_profile();
// Create a fake XULAppInfo to satisfy the eventual needs of the migrators. // Create a fake XULAppInfo to satisfy the eventual needs of the migrators.
let (XULAppInfo = { let XULAppInfo = {
// nsIXUlAppInfo // nsIXUlAppInfo
get vendor() "Mozilla", get vendor() "Mozilla",
get name() "XPCShell", get name() "XPCShell",
@ -48,17 +48,17 @@ let (XULAppInfo = {
throw Cr.NS_ERROR_NO_INTERFACE; throw Cr.NS_ERROR_NO_INTERFACE;
return this; return this;
} }
}) { };
const CONTRACT_ID = "@mozilla.org/xre/app-info;1";
const CID = Components.ID("7685dac8-3637-4660-a544-928c5ec0e714}");
let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); const CONTRACT_ID = "@mozilla.org/xre/app-info;1";
registrar.registerFactory(CID, "XULAppInfo", CONTRACT_ID, { const CID = Components.ID("7685dac8-3637-4660-a544-928c5ec0e714}");
let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
registrar.registerFactory(CID, "XULAppInfo", CONTRACT_ID, {
createInstance: function (aOuter, aIID) { createInstance: function (aOuter, aIID) {
if (aOuter != null) if (aOuter != null)
throw Cr.NS_ERROR_NO_AGGREGATION; throw Cr.NS_ERROR_NO_AGGREGATION;
return XULAppInfo.QueryInterface(aIID); return XULAppInfo.QueryInterface(aIID);
}, },
QueryInterface: XPCOMUtils.generateQI(Ci.nsIFactory) QueryInterface: XPCOMUtils.generateQI(Ci.nsIFactory)
}); });
}

Просмотреть файл

@ -11,16 +11,16 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
// We need to cache this before test runs... // We need to cache this before test runs...
let cachedLeftPaneFolderIdGetter; let cachedLeftPaneFolderIdGetter;
let (getter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId")) { let getter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId");
if (!cachedLeftPaneFolderIdGetter && typeof(getter) == "function") if (!cachedLeftPaneFolderIdGetter && typeof(getter) == "function") {
cachedLeftPaneFolderIdGetter = getter; cachedLeftPaneFolderIdGetter = getter;
} }
// ...And restore it when test ends. // ...And restore it when test ends.
registerCleanupFunction(function(){ registerCleanupFunction(function(){
let (getter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId")) { let getter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId");
if (cachedLeftPaneFolderIdGetter && typeof(getter) != "function") if (cachedLeftPaneFolderIdGetter && typeof(getter) != "function") {
PlacesUIUtils.__defineGetter__("leftPaneFolderId", PlacesUIUtils.__defineGetter__("leftPaneFolderId", cachedLeftPaneFolderIdGetter);
cachedLeftPaneFolderIdGetter);
} }
}); });

Просмотреть файл

@ -1841,10 +1841,9 @@ var gApplicationsPane = {
return this._getIconURLForSystemDefault(aHandlerInfo); return this._getIconURLForSystemDefault(aHandlerInfo);
case Ci.nsIHandlerInfo.useHelperApp: case Ci.nsIHandlerInfo.useHelperApp:
let (preferredApp = aHandlerInfo.preferredApplicationHandler) { let preferredApp = aHandlerInfo.preferredApplicationHandler;
if (this.isValidHandlerApp(preferredApp)) if (this.isValidHandlerApp(preferredApp))
return this._getIconURLForHandlerApp(preferredApp); return this._getIconURLForHandlerApp(preferredApp);
}
break; break;
// This should never happen, but if preferredAction is set to some weird // This should never happen, but if preferredAction is set to some weird

Просмотреть файл

@ -26,11 +26,10 @@ function test() {
} }
// delete existing sessionstore.js, to make sure we're not reading // delete existing sessionstore.js, to make sure we're not reading
// the mtime of an old one initialy // the mtime of an old one initially.
let (sessionStoreJS = getSessionstoreFile()) { let sessionStoreJS = getSessionstoreFile();
if (sessionStoreJS.exists()) if (sessionStoreJS.exists())
sessionStoreJS.remove(false); sessionStoreJS.remove(false);
}
// test content URL // test content URL
const TEST_URL = "data:text/html;charset=utf-8," const TEST_URL = "data:text/html;charset=utf-8,"

Просмотреть файл

@ -13,7 +13,7 @@ let Paths;
let SessionFile; let SessionFile;
// We need a XULAppInfo to initialize SessionFile // We need a XULAppInfo to initialize SessionFile
let (XULAppInfo = { let XULAppInfo = {
vendor: "Mozilla", vendor: "Mozilla",
name: "SessionRestoreTest", name: "SessionRestoreTest",
ID: "{230de50e-4cd1-11dc-8314-0800200c9a66}", ID: "{230de50e-4cd1-11dc-8314-0800200c9a66}",
@ -30,19 +30,19 @@ let (XULAppInfo = {
Ci.nsIXULAppInfo, Ci.nsIXULAppInfo,
Ci.nsIXULRuntime, Ci.nsIXULRuntime,
]) ])
}) { };
let XULAppInfoFactory = {
let XULAppInfoFactory = {
createInstance: function (outer, iid) { createInstance: function (outer, iid) {
if (outer != null) if (outer != null)
throw Cr.NS_ERROR_NO_AGGREGATION; throw Cr.NS_ERROR_NO_AGGREGATION;
return XULAppInfo.QueryInterface(iid); return XULAppInfo.QueryInterface(iid);
} }
}; };
let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
registrar.registerFactory(Components.ID("{fbfae60b-64a4-44ef-a911-08ceb70b9f31}"), registrar.registerFactory(Components.ID("{fbfae60b-64a4-44ef-a911-08ceb70b9f31}"),
"XULAppInfo", "@mozilla.org/xre/app-info;1", "XULAppInfo", "@mozilla.org/xre/app-info;1",
XULAppInfoFactory); XULAppInfoFactory);
};
function run_test() { function run_test() {
run_next_test(); run_next_test();