bug 814383 - fix javascript strict-mode warnings in browser.js. r=gavin

This commit is contained in:
Jonathan Kew 2012-11-26 16:18:25 +00:00
Родитель 895e7127a8
Коммит 9bbf39372f
4 изменённых файлов: 13 добавлений и 11 удалений

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

@ -91,7 +91,7 @@ const gXPInstallObserver = {
action, null, options);
break;
case "addon-install-started":
function needsDownload(aInstall) {
var needsDownload = function needsDownload(aInstall) {
return aInstall.state != AddonManager.STATE_DOWNLOADED;
}
// If all installs have already been downloaded then there is no need to

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

@ -358,7 +358,7 @@ var FullScreen = {
Services.perms.ALLOW_ACTION,
Services.perms.EXPIRE_SESSION);
let host = uri.host;
function onFullscreenchange(event) {
var onFullscreenchange = function onFullscreenchange(event) {
if (event.target == document && document.mozFullScreenElement == null) {
// The chrome document has left fullscreen. Remove the temporary permission grant.
Services.perms.remove(host, "fullscreen");
@ -545,7 +545,7 @@ var FullScreen = {
el.setAttribute("inFullscreen", true);
}
else {
function restoreAttr(attrName) {
var restoreAttr = function restoreAttr(attrName) {
var savedAttr = "saved-" + attrName;
if (el.hasAttribute(savedAttr)) {
el.setAttribute(attrName, el.getAttribute(savedAttr));

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

@ -116,7 +116,7 @@ var gPluginHandler = {
// Helper to get the binding handler type from a plugin object
_getBindingType : function(plugin) {
if (!(plugin instanceof Ci.nsIObjectLoadingContent))
return;
return null;
switch (plugin.pluginFallbackType) {
case Ci.nsIObjectLoadingContent.PLUGIN_UNSUPPORTED:
@ -137,7 +137,7 @@ var gPluginHandler = {
return "PluginPlayPreview";
default:
// Not all states map to a handler
return;
return null;
}
},

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

@ -105,6 +105,7 @@ XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function () {
document.getElementById("notification-popup-box"));
} catch (ex) {
Cu.reportError(ex);
return null;
}
});
@ -3310,7 +3311,7 @@ const BrowserSearch = {
win.BrowserSearch.webSearch();
} else {
// If there are no open browser windows, open a new one
function observer(subject, topic, data) {
var observer = function observer(subject, topic, data) {
if (subject == win) {
BrowserSearch.webSearch();
Services.obs.removeObserver(observer, "browser-delayed-startup-finished");
@ -4156,12 +4157,12 @@ var XULBrowserWindow = {
}
// Utility functions for disabling find
function shouldDisableFind(aDocument) {
var shouldDisableFind = function shouldDisableFind(aDocument) {
let docElt = aDocument.documentElement;
return docElt && docElt.getAttribute("disablefastfind") == "true";
}
function disableFindCommands(aDisable) {
var disableFindCommands = function disableFindCommands(aDisable) {
let findCommands = [document.getElementById("cmd_find"),
document.getElementById("cmd_findAgain"),
document.getElementById("cmd_findPrevious")];
@ -4173,7 +4174,7 @@ var XULBrowserWindow = {
}
}
function onContentRSChange(e) {
var onContentRSChange = function onContentRSChange(e) {
if (e.target.readyState != "interactive" && e.target.readyState != "complete")
return;
@ -5153,7 +5154,7 @@ function getBrowserSelection(aCharLen) {
// try getting a selected text in text input.
if (!selection) {
let element = commandDispatcher.focusedElement;
function isOnTextInput(elem) {
var isOnTextInput = function isOnTextInput(elem) {
// we avoid to return a value if a selection is in password field.
// ref. bug 565717
return elem instanceof HTMLTextAreaElement ||
@ -6276,7 +6277,7 @@ function BrowserOpenAddonsMgr(aView) {
let emWindow;
let browserWindow;
function receivePong(aSubject, aTopic, aData) {
var receivePong = function receivePong(aSubject, aTopic, aData) {
let browserWin = aSubject.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
@ -7454,6 +7455,7 @@ XPCOMUtils.defineLazyGetter(this, "HUDConsoleUI", function () {
}
catch (ex) {
Components.utils.reportError(ex);
return null;
}
});