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

Remove unused vars #8954

Merged
merged 17 commits into from
Sep 17, 2014
Merged

Remove unused vars #8954

merged 17 commits into from
Sep 17, 2014

Conversation

marcelgerber
Copy link
Contributor

Code cleanup for JSHint support

  • Removes unused vars (reported by JSHint)
  • Adjusts .jshintrc config: Remove obsolete prefs, add unused: "vars" (... will change our Travis results)
  • Remove unused /* globals */ (reported by JSHint)
  • Make ExtensionLoader.js pass JSLint

@@ -31,8 +31,7 @@ define(function (require, exports, module) {
var _ = require("thirdparty/lodash");

// Load dependent modules
var Global = require("utils/Global"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by note: we can't just remove unused references to Globals, since this is used to ensure a load order that sets up the global brackets.* members early enough. You'll have to change cases like this to a require() call that's not stored into a variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done (marcelgerber@5c44c87).
I didn't add it back to SidebarView as it never uses brackets.

@marcelgerber
Copy link
Contributor Author

Fixed the Travis build.

@@ -23,15 +23,13 @@


/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, maxerr: 50 */
/*global define, describe, it, xit, expect, beforeEach, afterEach, waitsFor, runs, $, brackets, waitsForDone */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because a test might have to be disabled at any time, perhaps xit should be added to the globals array in .jshintrc?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but xit should only be used as a temporary fix, so it's nice to get a warning from jslint as a reminder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually have 28 calls to xit in 10 files on current master.

Conflicts:
	src/brackets.js
	src/document/DocumentManager.js
	src/editor/EditorManager.js
	src/editor/ImageViewer.js
	src/extensions/default/JavaScriptQuickEdit/unittests.js
	src/extensions/default/UrlCodeHints/unittests.js
	src/language/CodeInspection.js
	src/project/WorkingSetSort.js
	src/project/WorkingSetView.js
	src/search/FindReplace.js
	src/search/ScrollTrackMarkers.js
	test/spec/FindReplace-test.js
	test/spec/LanguageManager-test.js
@marcelgerber marcelgerber force-pushed the unused-vars branch 2 times, most recently from 019eeb4 to 006967b Compare September 13, 2014 07:24
@ingorichter
Copy link
Contributor

I'm done with my review. There is nothing that made me nervous and I'd like to merge this change.

* @param {Object=} nodeMap If specified, a map of tag IDs to DOM nodes, used so we can indicate which tag name
* the DOM thinks corresponds to the given mark.
*/
function _dumpMarks(editor, nodeMap) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be removed. It's a handy debugging function.

@marcelgerber
Copy link
Contributor Author

Just did some other changes, mostly whitespace.
For just reviewing the actual changes, please use marcelgerber@7734b35?w=0.

@marcelgerber
Copy link
Contributor Author

Just double checked everything in this PR. All tests pass, JSHint doesn't complain, Travis succeeds.

@ingorichter Please let me know whether I should stash the changes.
And be aware merging this PR will break many open PRs and their Travis builds, and it will make JSHint behave rather different from JSLint.

@marcelgerber
Copy link
Contributor Author

(Didn't mean to close)

@ingorichter
Copy link
Contributor

@marcelgerber I'm aware that this will most likely to cause some of the existing PR's to choke. If we need to wait for a window where no PR is open and waiting to be merged, then we''l wait forever. :-)

@marcelgerber
Copy link
Contributor Author

@ingorichter That's what I thought as well ;)
Btw, I resolved the conflicts once again.

ingorichter added a commit that referenced this pull request Sep 17, 2014
@ingorichter ingorichter merged commit 6affa79 into adobe:master Sep 17, 2014
@ingorichter
Copy link
Contributor

Getting ready to rumble...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants