Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 6affa79

Browse files
committed
Merge pull request #8954 from MarcelGerber/unused-vars
Remove unused vars
2 parents b62de0a + 03a5533 commit 6affa79

212 files changed

Lines changed: 596 additions & 1040 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.jshintrc

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"regexp" : true,
1414
"undef" : true,
1515
"strict" : true,
16-
"trailing" : false,
16+
"unused" : "vars",
1717

1818
"asi" : false,
1919
"boss" : false,
@@ -35,15 +35,14 @@
3535
"proto" : false,
3636
"regexdash" : false,
3737
"scripturl" : false,
38-
"smarttabs" : false,
3938
"shadow" : false,
4039
"sub" : false,
4140
"supernew" : false,
4241
"validthis" : false,
4342

44-
"browser" : true,
43+
"browser" : false,
4544
"couch" : false,
46-
"devel" : false,
45+
"devel" : true,
4746
"dojo" : false,
4847
"jquery" : false,
4948
"mootools" : false,
@@ -52,24 +51,20 @@
5251
"prototypejs" : false,
5352
"rhino" : false,
5453
"wsh" : false,
55-
56-
"nomen" : false,
57-
"onevar" : false,
58-
"passfail" : false,
59-
"white" : false,
6054

6155
"maxerr" : 100,
62-
"predef" : [
63-
],
6456
"indent" : 4,
65-
"globals" : [
66-
"require",
67-
"define",
68-
"brackets",
69-
"$",
70-
"PathUtils",
71-
"window",
72-
"navigator",
73-
"Mustache"
74-
]
75-
}
57+
"globals" : {
58+
"window": false,
59+
"document": false,
60+
"setTimeout": false,
61+
"require": false,
62+
"define": false,
63+
"brackets": false,
64+
"$": false,
65+
"PathUtils": false,
66+
"window": false,
67+
"navigator": false,
68+
"Mustache": false
69+
}
70+
}

Gruntfile.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ module.exports = function (grunt) {
2727
// load dependencies
2828
require('load-grunt-tasks')(grunt, {pattern: ['grunt-contrib-*', 'grunt-targethtml', 'grunt-usemin']});
2929
grunt.loadTasks('tasks');
30-
31-
var common = require("./tasks/lib/common")(grunt);
3230

3331
// Project configuration.
3432
grunt.initConfig({

src/LiveDevelopment/Agents/DOMAgent.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ define(function DOMAgent(require, exports, module) {
4141
var $exports = $(exports);
4242

4343
var Inspector = require("LiveDevelopment/Inspector/Inspector");
44-
var RemoteAgent = require("LiveDevelopment/Agents/RemoteAgent");
4544
var EditAgent = require("LiveDevelopment/Agents/EditAgent");
4645
var DOMNode = require("LiveDevelopment/Agents/DOMNode");
4746
var DOMHelpers = require("LiveDevelopment/Agents/DOMHelpers");
@@ -123,14 +122,6 @@ define(function DOMAgent(require, exports, module) {
123122
Inspector.DOM.requestChildNodes(node.nodeId);
124123
}
125124

126-
/** Resolve a node
127-
* @param {DOMNode} node
128-
*/
129-
function resolveNode(node, callback) {
130-
console.assert(node.nodeId, "Attempted to resolve node without id");
131-
Inspector.DOM.resolveNode(node.nodeId, callback);
132-
}
133-
134125
/** Eliminate the query string from a URL
135126
* @param {string} URL
136127
*/
@@ -332,4 +323,4 @@ define(function DOMAgent(require, exports, module) {
332323
exports.applyChange = applyChange;
333324
exports.load = load;
334325
exports.unload = unload;
335-
});
326+
});

src/LiveDevelopment/Agents/DOMHelpers.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
26-
/*global define, $ */
26+
/*global define */
2727

2828
/**
2929
* DOMHelpers is a collection of functions used by the DOMAgent exports `eachNode(src, callback)`
@@ -230,7 +230,6 @@ define(function DOMHelpersModule(require, exports, module) {
230230
function eachNode(src, callback) {
231231
var index = 0;
232232
var text, range, length, payload;
233-
var x = 0;
234233
while (index < src.length) {
235234

236235
// find the next tag
@@ -267,4 +266,4 @@ define(function DOMHelpersModule(require, exports, module) {
267266
// Export public functions
268267
exports.extractPayload = extractPayload;
269268
exports.eachNode = eachNode;
270-
});
269+
});

src/LiveDevelopment/Agents/GotoAgent.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ define(function GotoAgent(require, exports, module) {
6767
*/
6868
function _makeHTMLTarget(targets, node) {
6969
if (node.location) {
70-
var target = {};
7170
var url = DOMAgent.url;
7271
var location = node.location;
7372
if (node.canHaveChildren()) {
@@ -86,7 +85,6 @@ define(function GotoAgent(require, exports, module) {
8685
*/
8786
function _makeCSSTarget(targets, rule) {
8887
if (rule.sourceURL) {
89-
var target = {};
9088
var url = rule.sourceURL;
9189
url += ":" + rule.style.range.start;
9290
var name = rule.selectorList.text;
@@ -102,7 +100,6 @@ define(function GotoAgent(require, exports, module) {
102100
function _makeJSTarget(targets, callFrame) {
103101
var script = ScriptAgent.scriptWithId(callFrame.location.scriptId);
104102
if (script && script.url) {
105-
var target = {};
106103
var url = script.url;
107104
url += ":" + callFrame.location.lineNumber + "," + callFrame.location.columnNumber;
108105
var name = callFrame.functionName;
@@ -121,7 +118,7 @@ define(function GotoAgent(require, exports, module) {
121118

122119
// get all css rules that apply to the given node
123120
Inspector.CSS.getMatchedStylesForNode(node.nodeId, function onMatchedStyles(res) {
124-
var i, callFrame, name, script, url, rule, targets = [];
121+
var i, targets = [];
125122
_makeHTMLTarget(targets, node);
126123
for (i in node.trace) {
127124
_makeJSTarget(targets, node.trace[i]);
@@ -221,4 +218,4 @@ define(function GotoAgent(require, exports, module) {
221218
exports.open = open;
222219
exports.load = load;
223220
exports.unload = unload;
224-
});
221+
});

src/LiveDevelopment/Agents/RemoteAgent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
26-
/*global define, $, XMLHttpRequest, window */
26+
/*global define, $, window */
2727

2828
/**
2929
* RemoteAgent defines and provides an interface for custom remote functions

src/LiveDevelopment/Agents/RemoteFunctions.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323

2424

2525
/*jslint vars: true, plusplus: true, browser: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */
26-
/*global define, $, window, navigator, Node, console */
26+
/*jshint unused: false */
27+
/*global window, navigator, Node, console */
2728
/*theseus instrument: false */
2829

2930
/**
@@ -814,4 +815,4 @@ function RemoteFunctions(experimental) {
814815
"applyDOMEdits" : applyDOMEdits,
815816
"getSimpleDOM" : getSimpleDOM
816817
};
817-
}
818+
}

src/LiveDevelopment/Agents/ScriptAgent.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,6 @@ define(function ScriptAgent(require, exports, module) {
4040
var _idToScript; // id -> script info
4141
var _insertTrace; // the last recorded trace of a DOM insertion
4242

43-
/** Add a call stack trace to a node
44-
* @param {integer} node id
45-
* @param [{Debugger.CallFrame}] call stack
46-
*/
47-
function _addTraceToNode(nodeId, trace) {
48-
var node = DOMAgent.nodeWithId(nodeId);
49-
node.trace = trace;
50-
}
51-
5243
// TODO: should the parameter to this be an ID rather than a URL?
5344
/** Get the script information for a given url
5445
* @param {string} url

src/LiveDevelopment/Documents/CSSDocument.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ define(function CSSDocumentModule(require, exports, module) {
176176
CSSDocument.prototype.updateHighlight = function () {
177177
if (Inspector.config.highlight && this.editor) {
178178
var editor = this.editor,
179-
codeMirror = editor._codeMirror,
180179
selectors = [];
181180
_.each(this.editor.getSelections(), function (sel) {
182181
var selector = CSSUtils.findSelectorAtDocumentPos(editor, (sel.reversed ? sel.end : sel.start));

src/LiveDevelopment/Documents/CSSPreprocessorDocument.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ define(function CSSPreprocessorDocumentModule(require, exports, module) {
9797
CSSPreprocessorDocument.prototype.updateHighlight = function () {
9898
if (Inspector.config.highlight && this.editor) {
9999
var editor = this.editor,
100-
codeMirror = editor._codeMirror,
101100
selectors = [];
102101
_.each(this.editor.getSelections(), function (sel) {
103102
var selector = CSSUtils.findSelectorAtDocumentPos(editor, (sel.reversed ? sel.end : sel.start));

0 commit comments

Comments
 (0)