[Pkg-mozext-commits] [firebug] 31/82: Some JSHint cleanliness
David Prévot
taffit at moszumanska.debian.org
Mon Mar 31 22:45:38 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag fbtest-1.11.2
in repository firebug.
commit f188e1692eab6e65903499b91f7be3bb5b7d6698
Author: Simon Lindholm <simon.lindholm10 at gmail.com>
Date: Sun Dec 30 01:44:38 2012 +0100
Some JSHint cleanliness
---
.../content/firebug/console/closureInspector.js | 2 +-
.../content/firebug/console/commandLineExposed.js | 24 +++++++++++-----------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/extension/content/firebug/console/closureInspector.js b/extension/content/firebug/console/closureInspector.js
index 7d91676..ea9ef71 100644
--- a/extension/content/firebug/console/closureInspector.js
+++ b/extension/content/firebug/console/closureInspector.js
@@ -337,7 +337,7 @@ var ClosureInspector =
if (ind !== -1 && self.getVariableOrOptimizedAway(scope, "arguments") === OptimizedAway)
names.splice(ind, 1);
- namesSet = new Set;
+ namesSet = new Set();
for (var i = 0; i < names.length; ++i)
namesSet.add(names[i]);
};
diff --git a/extension/content/firebug/console/commandLineExposed.js b/extension/content/firebug/console/commandLineExposed.js
index 3cfe20a..c72200b 100644
--- a/extension/content/firebug/console/commandLineExposed.js
+++ b/extension/content/firebug/console/commandLineExposed.js
@@ -1,10 +1,13 @@
/* See license.txt for terms of usage */
+/*jshint esnext:true, es5:true, curly:false */
+/*global Firebug:true, FBTrace:true, Components:true, define:true */
define([
"firebug/lib/wrapper",
"firebug/lib/events",
],
function(Wrapper, Events) {
+"use strict";
// ********************************************************************************************* //
// Command Line APIs
@@ -56,19 +59,19 @@ function createFirebugCommandLine(context, win)
function createCommandHandler(cmd) {
return function() {
return notifyFirebug(arguments, cmd, "firebugExecuteCommand");
- }
+ };
}
function createShortcutHandler(cmd) {
return function() {
return console[cmd].apply(console, arguments);
- }
+ };
}
function createVariableHandler(prop) {
return function() {
return notifyFirebug(arguments, prop, "firebugExecuteCommand");
- }
+ };
}
// Define command line methods
@@ -146,10 +149,7 @@ function createFirebugCommandLine(context, win)
FBTrace.sysout("commandLine.Exposed.attachCommandLine; " + window.location);
if (!contentView.console)
- {
- var console = createFirebugConsole(context, win);
contentView.console = console;
- }
Events.addEventListener(contentView.document, "firebugCommandLine",
firebugEvalEvent, true);
@@ -182,10 +182,11 @@ function createFirebugCommandLine(context, win)
function evaluate(expr)
{
+ var result;
try
{
var line = Components.stack.lineNumber;
- var result = contentView.eval(expr);
+ result = contentView.eval(expr);
// See Issue 5221
//var result = FirebugEvaluate(expr, contentView);
@@ -203,13 +204,12 @@ function createFirebugCommandLine(context, win)
if (shouldModify)
{
- var result = new Error;
+ result = new Error();
result.stack = null;
result.source = expr;
result.message = exc.message;
result.lineNumber = exc.lineNumber - line;
result.fileName = "data:," + encodeURIComponent(expr);
-
if (!isXPCException)
result.name = exc.name;
}
@@ -243,10 +243,10 @@ function createFirebugCommandLine(context, win)
}
var result;
- if (contentView.document.getUserData("firebug-retValueType") == "array")
+ if (contentView.document.getUserData("firebug-retValueType") === "array")
result = [];
- if (!result && commandLine.userObjects.length == length + 1)
+ if (!result && commandLine.userObjects.length === length + 1)
return commandLine.userObjects[length];
for (var i=length; i<commandLine.userObjects.length && result; i++)
@@ -256,7 +256,7 @@ function createFirebugCommandLine(context, win)
}
return commandLine;
-};
+}
/* see Issue 5221
// chrome: urls are filtered out by debugger, so we create script with a data url
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git
More information about the Pkg-mozext-commits
mailing list