Bug 869565 - Fix strict errors and warnings in the browser console; r=me

This commit is contained in:
Mihai Sucan 2013-05-08 21:54:57 +03:00
parent 27b0919480
commit 58d1521b0c

View File

@ -971,7 +971,7 @@ WebConsoleFrame.prototype = {
*
* @param object aMessage
* The message received from the server.
* @return nsIDOMElement|undefined
* @return nsIDOMElement|null
* The message element to display in the Web Console output.
*/
logConsoleAPIMessage: function WCF_logConsoleAPIMessage(aMessage)
@ -1046,11 +1046,11 @@ WebConsoleFrame.prototype = {
case "time": {
let timer = aMessage.timer;
if (!timer) {
return;
return null;
}
if (timer.error) {
Cu.reportError(l10n.getStr(timer.error));
return;
return null;
}
body = l10n.getFormatStr("timerStarted", [timer.name]);
clipboardText = body;
@ -1060,7 +1060,7 @@ WebConsoleFrame.prototype = {
case "timeEnd": {
let timer = aMessage.timer;
if (!timer) {
return;
return null;
}
let duration = Math.round(timer.duration * 100) / 100;
body = l10n.getFormatStr("timeEnd", [timer.name, duration]);
@ -1070,7 +1070,7 @@ WebConsoleFrame.prototype = {
default:
Cu.reportError("Unknown Console API log level: " + level);
return;
return null;
}
// Release object actors for arguments coming from console API methods that
@ -1089,7 +1089,7 @@ WebConsoleFrame.prototype = {
}
if (level == "groupEnd") {
return; // no need to continue
return null; // no need to continue
}
let node = this.createMessageNode(CATEGORY_WEBDEV, LEVELS[level], body,
@ -1193,14 +1193,14 @@ WebConsoleFrame.prototype = {
*
* @param object aActorId
* The network event actor ID to log.
* @return nsIDOMElement|undefined
* @return nsIDOMElement|null
* The message element to display in the Web Console output.
*/
logNetEvent: function WCF_logNetEvent(aActorId)
{
let networkInfo = this._networkRequests[aActorId];
if (!networkInfo) {
return;
return null;
}
let request = networkInfo.request;
@ -2236,7 +2236,7 @@ WebConsoleFrame.prototype = {
if (aItem && typeof aItem != "object" || !inspectable) {
aContainer.appendChild(this.document.createTextNode(text));
if (aItem.type == "longString") {
if (aItem.type && aItem.type == "longString") {
let ellipsis = this.document.createElement("description");
ellipsis.classList.add("hud-clickable");
ellipsis.classList.add("longStringEllipsis");
@ -4422,7 +4422,7 @@ CommandController.prototype = {
case "consoleCmd_copyURL": {
// Only enable URL-related actions if node is Net Activity.
let selectedItem = this.owner.outputNode.selectedItem;
return selectedItem && selectedItem.url;
return selectedItem && "url" in selectedItem;
}
case "cmd_fontSizeEnlarge":
case "cmd_fontSizeReduce":
@ -4432,6 +4432,7 @@ CommandController.prototype = {
case "cmd_close":
return this.owner.owner._browserConsole;
}
return false;
},
doCommand: function CommandController_doCommand(aCommand)