зеркало из https://github.com/mozilla/gecko-dev.git
bug 814383 - fix javascript strict-mode warnings in browser.js. r=gavin
This commit is contained in:
Родитель
895e7127a8
Коммит
9bbf39372f
|
@ -91,7 +91,7 @@ const gXPInstallObserver = {
|
||||||
action, null, options);
|
action, null, options);
|
||||||
break;
|
break;
|
||||||
case "addon-install-started":
|
case "addon-install-started":
|
||||||
function needsDownload(aInstall) {
|
var needsDownload = function needsDownload(aInstall) {
|
||||||
return aInstall.state != AddonManager.STATE_DOWNLOADED;
|
return aInstall.state != AddonManager.STATE_DOWNLOADED;
|
||||||
}
|
}
|
||||||
// If all installs have already been downloaded then there is no need to
|
// 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.ALLOW_ACTION,
|
||||||
Services.perms.EXPIRE_SESSION);
|
Services.perms.EXPIRE_SESSION);
|
||||||
let host = uri.host;
|
let host = uri.host;
|
||||||
function onFullscreenchange(event) {
|
var onFullscreenchange = function onFullscreenchange(event) {
|
||||||
if (event.target == document && document.mozFullScreenElement == null) {
|
if (event.target == document && document.mozFullScreenElement == null) {
|
||||||
// The chrome document has left fullscreen. Remove the temporary permission grant.
|
// The chrome document has left fullscreen. Remove the temporary permission grant.
|
||||||
Services.perms.remove(host, "fullscreen");
|
Services.perms.remove(host, "fullscreen");
|
||||||
|
@ -545,7 +545,7 @@ var FullScreen = {
|
||||||
el.setAttribute("inFullscreen", true);
|
el.setAttribute("inFullscreen", true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
function restoreAttr(attrName) {
|
var restoreAttr = function restoreAttr(attrName) {
|
||||||
var savedAttr = "saved-" + attrName;
|
var savedAttr = "saved-" + attrName;
|
||||||
if (el.hasAttribute(savedAttr)) {
|
if (el.hasAttribute(savedAttr)) {
|
||||||
el.setAttribute(attrName, el.getAttribute(savedAttr));
|
el.setAttribute(attrName, el.getAttribute(savedAttr));
|
||||||
|
|
|
@ -116,7 +116,7 @@ var gPluginHandler = {
|
||||||
// Helper to get the binding handler type from a plugin object
|
// Helper to get the binding handler type from a plugin object
|
||||||
_getBindingType : function(plugin) {
|
_getBindingType : function(plugin) {
|
||||||
if (!(plugin instanceof Ci.nsIObjectLoadingContent))
|
if (!(plugin instanceof Ci.nsIObjectLoadingContent))
|
||||||
return;
|
return null;
|
||||||
|
|
||||||
switch (plugin.pluginFallbackType) {
|
switch (plugin.pluginFallbackType) {
|
||||||
case Ci.nsIObjectLoadingContent.PLUGIN_UNSUPPORTED:
|
case Ci.nsIObjectLoadingContent.PLUGIN_UNSUPPORTED:
|
||||||
|
@ -137,7 +137,7 @@ var gPluginHandler = {
|
||||||
return "PluginPlayPreview";
|
return "PluginPlayPreview";
|
||||||
default:
|
default:
|
||||||
// Not all states map to a handler
|
// Not all states map to a handler
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,7 @@ XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function () {
|
||||||
document.getElementById("notification-popup-box"));
|
document.getElementById("notification-popup-box"));
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
Cu.reportError(ex);
|
Cu.reportError(ex);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3310,7 +3311,7 @@ const BrowserSearch = {
|
||||||
win.BrowserSearch.webSearch();
|
win.BrowserSearch.webSearch();
|
||||||
} else {
|
} else {
|
||||||
// If there are no open browser windows, open a new one
|
// 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) {
|
if (subject == win) {
|
||||||
BrowserSearch.webSearch();
|
BrowserSearch.webSearch();
|
||||||
Services.obs.removeObserver(observer, "browser-delayed-startup-finished");
|
Services.obs.removeObserver(observer, "browser-delayed-startup-finished");
|
||||||
|
@ -4156,12 +4157,12 @@ var XULBrowserWindow = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Utility functions for disabling find
|
// Utility functions for disabling find
|
||||||
function shouldDisableFind(aDocument) {
|
var shouldDisableFind = function shouldDisableFind(aDocument) {
|
||||||
let docElt = aDocument.documentElement;
|
let docElt = aDocument.documentElement;
|
||||||
return docElt && docElt.getAttribute("disablefastfind") == "true";
|
return docElt && docElt.getAttribute("disablefastfind") == "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableFindCommands(aDisable) {
|
var disableFindCommands = function disableFindCommands(aDisable) {
|
||||||
let findCommands = [document.getElementById("cmd_find"),
|
let findCommands = [document.getElementById("cmd_find"),
|
||||||
document.getElementById("cmd_findAgain"),
|
document.getElementById("cmd_findAgain"),
|
||||||
document.getElementById("cmd_findPrevious")];
|
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")
|
if (e.target.readyState != "interactive" && e.target.readyState != "complete")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -5153,7 +5154,7 @@ function getBrowserSelection(aCharLen) {
|
||||||
// try getting a selected text in text input.
|
// try getting a selected text in text input.
|
||||||
if (!selection) {
|
if (!selection) {
|
||||||
let element = commandDispatcher.focusedElement;
|
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.
|
// we avoid to return a value if a selection is in password field.
|
||||||
// ref. bug 565717
|
// ref. bug 565717
|
||||||
return elem instanceof HTMLTextAreaElement ||
|
return elem instanceof HTMLTextAreaElement ||
|
||||||
|
@ -6276,7 +6277,7 @@ function BrowserOpenAddonsMgr(aView) {
|
||||||
let emWindow;
|
let emWindow;
|
||||||
let browserWindow;
|
let browserWindow;
|
||||||
|
|
||||||
function receivePong(aSubject, aTopic, aData) {
|
var receivePong = function receivePong(aSubject, aTopic, aData) {
|
||||||
let browserWin = aSubject.QueryInterface(Ci.nsIInterfaceRequestor)
|
let browserWin = aSubject.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||||
.getInterface(Ci.nsIWebNavigation)
|
.getInterface(Ci.nsIWebNavigation)
|
||||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||||
|
@ -7454,6 +7455,7 @@ XPCOMUtils.defineLazyGetter(this, "HUDConsoleUI", function () {
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
Components.utils.reportError(ex);
|
Components.utils.reportError(ex);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче