From 7d81bfea9f22423e3182dc6a137671a98564d05d Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Tue, 8 Nov 2016 12:49:32 +0000 Subject: [PATCH] Bug 1315951 - Fix no-unused-vars issues in toolkit/components (except places). r=mossop MozReview-Commit-ID: 8svkCKZHxsq --HG-- extra : rebase_source : 01552e8214f02490aad3cf704757f52a9c3b3959 --- toolkit/.eslintrc.js | 6 +++++- toolkit/components/.eslintrc.js | 11 +++++++++++ .../components/aboutmemory/content/aboutMemory.js | 2 +- .../aboutperformance/content/aboutPerformance.js | 3 +-- .../tests/browser/browser_aboutperformance.js | 1 - toolkit/components/addoncompat/Prefetcher.jsm | 6 +++--- toolkit/components/addoncompat/multiprocessShims.js | 1 - .../alerts/test/test_alerts_requireinteraction.html | 1 - toolkit/components/alerts/test/test_image.html | 2 +- toolkit/components/asyncshutdown/AsyncShutdown.jsm | 1 - .../autocomplete/tests/unit/test_immediate_search.js | 3 --- .../autocomplete/tests/unit/test_previousResult.js | 2 -- .../components/cookie/content/cookieAcceptDialog.js | 1 - toolkit/components/crashes/CrashManager.jsm | 2 +- toolkit/components/crashes/CrashService.js | 2 +- .../ctypes/tests/unit/test_finalizer_shouldfail.js | 2 +- .../components/ctypes/tests/unit/test_jsctypes.js | 6 +----- .../components/downloads/test/unit/test_app_rep.js | 2 -- .../downloads/test/unit/test_app_rep_maclinux.js | 2 -- .../downloads/test/unit/test_app_rep_windows.js | 2 -- toolkit/components/feeds/FeedProcessor.js | 4 +--- toolkit/components/filepicker/content/filepicker.js | 2 -- toolkit/components/filepicker/nsFilePicker.js | 12 ------------ toolkit/components/gfx/SanityTest.js | 2 -- .../jsdownloads/test/unit/common_test_Download.js | 4 ++-- toolkit/components/jsdownloads/test/unit/head.js | 5 ----- .../test/unit/test_DownloadIntegration.js | 2 +- .../jsdownloads/test/unit/test_DownloadStore.js | 2 +- .../mediasniffer/test/unit/test_mediasniffer_ext.js | 3 +-- .../tests/browser/browser_AddonWatcher.js | 9 --------- .../tests/browser/browser_compartments.js | 3 --- .../components/printing/content/printjoboptions.js | 2 -- toolkit/components/promiseworker/PromiseWorker.jsm | 2 -- toolkit/components/prompts/content/selectDialog.js | 1 - toolkit/components/prompts/content/tabprompts.xml | 1 - toolkit/components/satchel/FormHistory.jsm | 1 - toolkit/components/satchel/nsFormHistory.js | 2 +- toolkit/components/satchel/test/test_bug_511615.html | 2 +- toolkit/components/satchel/test/unit/test_notify.js | 2 -- .../components/search/tests/xpcshell/head_search.js | 2 -- .../search/tests/xpcshell/test_identifiers.js | 2 +- .../search/tests/xpcshell/test_json_cache.js | 3 +-- .../search/tests/xpcshell/test_location_sync.js | 2 +- .../search/tests/xpcshell/test_sync_migration.js | 2 +- .../telemetry/tests/unit/test_ChildHistograms.js | 2 +- .../components/telemetry/tests/unit/test_PingAPI.js | 3 +-- .../telemetry/tests/unit/test_TelemetryController.js | 3 --- .../tests/unit/test_TelemetryEnvironment.js | 2 -- .../tests/unit/test_TelemetryReportingPolicy.js | 2 +- .../telemetry/tests/unit/test_TelemetrySend.js | 2 +- .../tests/unit/test_TelemetrySendOldPings.js | 2 +- .../telemetry/tests/unit/test_TelemetrySession.js | 11 ++++------- .../telemetry/tests/unit/test_nsITelemetry.js | 2 -- toolkit/components/thumbnails/PageThumbs.jsm | 1 - .../test/browser_thumbnails_storage_migrate3.js | 4 ---- .../tooltiptext/tests/browser_bug581947.js | 3 --- .../viewsource/content/viewSource-content.js | 5 ++--- .../components/viewsource/content/viewSourceUtils.js | 1 - .../viewsource/test/browser/browser_gotoline.js | 1 - toolkit/components/workerloader/require.js | 2 -- 60 files changed, 49 insertions(+), 127 deletions(-) create mode 100644 toolkit/components/.eslintrc.js diff --git a/toolkit/.eslintrc.js b/toolkit/.eslintrc.js index d3cd9cef7ee1..181f19f29f2b 100644 --- a/toolkit/.eslintrc.js +++ b/toolkit/.eslintrc.js @@ -154,7 +154,11 @@ module.exports = { "no-unreachable": "error", // No declaring variables that are never used - // "no-unused-vars": ["error", {"vars": "all", "args": "none"}], + // "no-unused-vars": ["error", { + // "vars": "local", + // "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS", + // "args": "none", + // }], // No using variables before defined // "no-use-before-define": ["error", "nofunc"], diff --git a/toolkit/components/.eslintrc.js b/toolkit/components/.eslintrc.js new file mode 100644 index 000000000000..e6cf2032e817 --- /dev/null +++ b/toolkit/components/.eslintrc.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = { + "rules": { + "no-unused-vars": ["error", { + "vars": "local", + "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS", + "args": "none", + }] + } +}; diff --git a/toolkit/components/aboutmemory/content/aboutMemory.js b/toolkit/components/aboutmemory/content/aboutMemory.js index 1706677263c3..2f3889a5b19c 100644 --- a/toolkit/components/aboutmemory/content/aboutMemory.js +++ b/toolkit/components/aboutmemory/content/aboutMemory.js @@ -1227,7 +1227,7 @@ function fillInTree(aRoot) } else { delete aT._kids; } - aT._amount = kid._amount; + aT._amount = kidBytes; aT._description = kid._description; if (kid._nMerged !== undefined) { aT._nMerged = kid._nMerged diff --git a/toolkit/components/aboutperformance/content/aboutPerformance.js b/toolkit/components/aboutperformance/content/aboutPerformance.js index e0d34128a39c..3b191d8950eb 100644 --- a/toolkit/components/aboutperformance/content/aboutPerformance.js +++ b/toolkit/components/aboutperformance/content/aboutPerformance.js @@ -569,7 +569,7 @@ var View = { } // Grab everything from the DOM before cleaning up - let eltContainer = this._setupStructure(id); + this._setupStructure(id); // An array of `cachedElements` that need to be added let toAdd = []; @@ -649,7 +649,6 @@ var View = { cachedElements.eltRoot.setAttribute("impact", Math.round(impact)); } - let result = delta.diff.jank.totalCPUTime/delta.diff.deltaT; cachedElements.eltCPU.textContent = `CPU usage: ${Math.ceil(delta.diff.jank.totalCPUTime/delta.diff.deltaT/10)}% (total ${delta.diff.jank.totalUserTime}ms).`; cachedElements.eltSystem.textContent = `System usage: ${Math.ceil(delta.diff.jank.totalSystemTime/delta.diff.deltaT/10)}% (total ${delta.diff.jank.totalSystemTime}ms).`; cachedElements.eltCPOW.textContent = `Blocking process calls: ${Math.ceil(delta.diff.cpow.totalCPOWTime/delta.diff.deltaT/10)}% (total ${delta.diff.cpow.totalCPOWTime}ms).`; diff --git a/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js b/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js index 273c2f2e0e26..60760ea7f80e 100644 --- a/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js +++ b/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js @@ -68,7 +68,6 @@ function frameScript() { try { let reFullname = /Full name: (.+)/; let reFps = /Impact on framerate: (\d+)\/10( \((\d+) alerts\))?/; - let reCpu = /CPU usage: (\d+)%/ let reCpow = /Blocking process calls: (\d+)%( \((\d+) alerts\))?/; let getContentOfSelector = function(eltContainer, selector, re) { diff --git a/toolkit/components/addoncompat/Prefetcher.jsm b/toolkit/components/addoncompat/Prefetcher.jsm index 9510eb7598b3..2d836690cc23 100644 --- a/toolkit/components/addoncompat/Prefetcher.jsm +++ b/toolkit/components/addoncompat/Prefetcher.jsm @@ -163,7 +163,7 @@ PropertyOp.prototype.addObject = function(database, obj) PropertyOp.prototype.makeCacheEntry = function(item, cache) { - let [index, obj, has, propValue] = item; + let [, obj, , propValue] = item; let desc = { configurable: false, enumerable: true, writable: false, value: propValue }; @@ -201,7 +201,7 @@ MethodOp.prototype.addObject = function(database, obj) MethodOp.prototype.makeCacheEntry = function(item, cache) { - let [index, obj, result] = item; + let [, obj, result] = item; if (!cache.has(obj)) { cache.set(obj, new Map()); @@ -256,7 +256,7 @@ CollectionOp.prototype.addObject = function(database, obj) CollectionOp.prototype.makeCacheEntry = function(item, cache) { - let [index, obj, ...elements] = item; + let [, obj, ...elements] = item; if (!cache.has(obj)) { cache.set(obj, new Map()); diff --git a/toolkit/components/addoncompat/multiprocessShims.js b/toolkit/components/addoncompat/multiprocessShims.js index 6c8d559b3c46..8b252a0c484a 100644 --- a/toolkit/components/addoncompat/multiprocessShims.js +++ b/toolkit/components/addoncompat/multiprocessShims.js @@ -113,7 +113,6 @@ AddonInterpositionService.prototype = { return Cu.getCrossProcessWrapperTag(target); } - const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; if (target instanceof Ci.nsIDOMXULElement) { if (target.localName == "browser" && target.isRemoteBrowser) { return "RemoteBrowserElement"; diff --git a/toolkit/components/alerts/test/test_alerts_requireinteraction.html b/toolkit/components/alerts/test/test_alerts_requireinteraction.html index a5e3a4004f1f..26fe87104628 100644 --- a/toolkit/components/alerts/test/test_alerts_requireinteraction.html +++ b/toolkit/components/alerts/test/test_alerts_requireinteraction.html @@ -98,7 +98,6 @@ add_task(function* test_require_interaction() { var actualSequence = []; - var sequenceIdx = 0; function createAlertListener(name, showCallback, finishCallback) { return (subject, topic, data) => { if (topic == "alertshow") { diff --git a/toolkit/components/alerts/test/test_image.html b/toolkit/components/alerts/test/test_image.html index 8998398ab6a0..7bf89fab22be 100644 --- a/toolkit/components/alerts/test/test_image.html +++ b/toolkit/components/alerts/test/test_image.html @@ -51,7 +51,7 @@ add_task(function* testContext() { inUserData.data = 123; var alert = makeAlert(null, imageServerURL + "?f=image.png"); - var [ready, request, userData] = yield promiseImage(alert, 0, inUserData); + var [ready, , userData] = yield promiseImage(alert, 0, inUserData); ok(ready, "Should load requested image"); is(userData.QueryInterface(Ci.nsISupportsPRInt64).data, 123, "Should pass user data for loaded image"); diff --git a/toolkit/components/asyncshutdown/AsyncShutdown.jsm b/toolkit/components/asyncshutdown/AsyncShutdown.jsm index d80ede13a1dd..62ac36f42c21 100644 --- a/toolkit/components/asyncshutdown/AsyncShutdown.jsm +++ b/toolkit/components/asyncshutdown/AsyncShutdown.jsm @@ -525,7 +525,6 @@ Spinner.prototype = { observe: function() { let topic = this._topic; debug(`Starting phase ${ topic }`); - let barrier = this._barrier; Services.obs.removeObserver(this, topic); let satisfied = false; // |true| once we have satisfied all conditions diff --git a/toolkit/components/autocomplete/tests/unit/test_immediate_search.js b/toolkit/components/autocomplete/tests/unit/test_immediate_search.js index 17016cefb855..0579f5dcb091 100644 --- a/toolkit/components/autocomplete/tests/unit/test_immediate_search.js +++ b/toolkit/components/autocomplete/tests/unit/test_immediate_search.js @@ -35,7 +35,6 @@ function run_test() { * An immediate search should be executed synchronously. */ add_test(function test_immediate_search() { - let immediateResults = ["mozillaTest"]; let inputStr = "moz"; let immediateSearch = new AutoCompleteImmediateSearch( @@ -79,7 +78,6 @@ add_test(function test_immediate_search() { * An immediate search should be executed before any delayed search. */ add_test(function test_immediate_search_notimeout() { - let immediateResults = ["mozillaTest"]; let inputStr = "moz"; let immediateSearch = new AutoCompleteImmediateSearch( @@ -124,7 +122,6 @@ add_test(function test_immediate_search_notimeout() { * A delayed search should be executed synchronously with a zero timeout. */ add_test(function test_delayed_search_notimeout() { - let immediateResults = ["mozillaTest"]; let inputStr = "moz"; let delayedSearch = new AutoCompleteDelayedSearch( diff --git a/toolkit/components/autocomplete/tests/unit/test_previousResult.js b/toolkit/components/autocomplete/tests/unit/test_previousResult.js index 01736ee6e51b..bfe6c7aaea58 100644 --- a/toolkit/components/autocomplete/tests/unit/test_previousResult.js +++ b/toolkit/components/autocomplete/tests/unit/test_previousResult.js @@ -243,7 +243,6 @@ function run_test() { var input = new AutoCompleteInput([search1.name, search2.name]); var numSearchesStarted = 0; - var previousResult = null; input.onSearchBegin = function() { numSearchesStarted++; @@ -279,4 +278,3 @@ function run_test() { controller.startSearch("test"); } - diff --git a/toolkit/components/cookie/content/cookieAcceptDialog.js b/toolkit/components/cookie/content/cookieAcceptDialog.js index 8c579be7af6b..4b322e95d983 100644 --- a/toolkit/components/cookie/content/cookieAcceptDialog.js +++ b/toolkit/components/cookie/content/cookieAcceptDialog.js @@ -59,7 +59,6 @@ function onload() if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) { try { params = window.arguments[0].QueryInterface(nsIDialogParamBlock); - var objects = params.objects; var cookie = params.objects.queryElementAt(0, nsICookie); var cookiesFromHost = params.GetInt(nsICookieAcceptDialog.COOKIESFROMHOST); diff --git a/toolkit/components/crashes/CrashManager.jsm b/toolkit/components/crashes/CrashManager.jsm index 8c3d8fbd2b98..3aac33254abe 100644 --- a/toolkit/components/crashes/CrashManager.jsm +++ b/toolkit/components/crashes/CrashManager.jsm @@ -1043,7 +1043,7 @@ CrashStore.prototype = Object.freeze({ */ get crashes() { let crashes = []; - for (let [id, crash] of this._data.crashes) { + for (let [, crash] of this._data.crashes) { crashes.push(new CrashRecord(crash)); } diff --git a/toolkit/components/crashes/CrashService.js b/toolkit/components/crashes/CrashService.js index 4ac584fbe4ec..56f8b69e74e6 100644 --- a/toolkit/components/crashes/CrashService.js +++ b/toolkit/components/crashes/CrashService.js @@ -62,7 +62,7 @@ CrashService.prototype = Object.freeze({ switch (topic) { case "profile-after-change": // Side-effect is the singleton is instantiated. - let m = Services.crashmanager; + Services.crashmanager; break; } }, diff --git a/toolkit/components/ctypes/tests/unit/test_finalizer_shouldfail.js b/toolkit/components/ctypes/tests/unit/test_finalizer_shouldfail.js index 5460f9b66131..ffbe1b613a6a 100644 --- a/toolkit/components/ctypes/tests/unit/test_finalizer_shouldfail.js +++ b/toolkit/components/ctypes/tests/unit/test_finalizer_shouldfail.js @@ -113,7 +113,7 @@ function test_null_dispose() exception = false; try { - let v = ctypes.CDataFinalizer(acquire(0), null_dispose); + ctypes.CDataFinalizer(acquire(0), null_dispose); } catch (x) { exception = true; } diff --git a/toolkit/components/ctypes/tests/unit/test_jsctypes.js b/toolkit/components/ctypes/tests/unit/test_jsctypes.js index 340583ace3d1..ec35ee18e8d4 100644 --- a/toolkit/components/ctypes/tests/unit/test_jsctypes.js +++ b/toolkit/components/ctypes/tests/unit/test_jsctypes.js @@ -1437,7 +1437,6 @@ function run_StructType_tests() { do_check_eq(g_t.array().name, name + "[]"); do_check_eq(g_t.array(5).name, name + "[5]"); - let h_t = ctypes.StructType("h_t", [{ a: ctypes.int32_t }, { b: ctypes.int16_t }]); let s_t = new ctypes.StructType("s_t", [{ a: ctypes.int32_t }, { b: g_t }, { c: ctypes.int8_t }]); let fields = [{ a: ctypes.int32_t }, { b: ctypes.int8_t }, { c: g_t }, { d: ctypes.int8_t }]; @@ -1845,7 +1844,6 @@ function run_FunctionType_tests() { }, Error); let g_t = ctypes.StructType("g_t", [{ a: ctypes.int32_t }, { b: ctypes.double }]); - let g = g_t(1, 2); let f_t = ctypes.FunctionType(ctypes.default_abi, g_t); let name = "g_t()"; @@ -2172,7 +2170,6 @@ function run_cast_tests() { // Test casting between special types. let g_t = ctypes.StructType("g_t", [{ a: ctypes.int32_t }, { b: ctypes.double }]); let a_t = ctypes.ArrayType(g_t, 4); - let p_t = ctypes.PointerType(g_t); let f_t = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t).ptr; let a = a_t(); @@ -2184,7 +2181,6 @@ function run_cast_tests() { let a2 = ctypes.cast(g, g_t.array(1)); do_check_eq(ptrValue(a2.address()), ptrValue(g.address())); do_check_eq(a2[0].a, g.a); - let a3 = ctypes.cast(g, g_t.array(0)); let p = g.address(); let ip = ctypes.cast(p, ctypes.int32_t.ptr); @@ -2215,7 +2211,7 @@ function run_void_tests(library) { // Win32 (it's all the same on Win64 though). if (ctypes.voidptr_t.size == 4) { do_check_throws(function() { - let test_winapi_t = library.declare("test_void_t_stdcall", ctypes.winapi_abi, ctypes.void_t); + library.declare("test_void_t_stdcall", ctypes.winapi_abi, ctypes.void_t); }, Error); } } diff --git a/toolkit/components/downloads/test/unit/test_app_rep.js b/toolkit/components/downloads/test/unit/test_app_rep.js index 5c1a286296b9..636a71e78fbf 100644 --- a/toolkit/components/downloads/test/unit/test_app_rep.js +++ b/toolkit/components/downloads/test/unit/test_app_rep.js @@ -187,8 +187,6 @@ add_test(function test_local_list() { return response; } gHttpServ.registerPathHandler("/downloads", function(request, response) { - let buf = NetUtil.readInputStreamToString(request.bodyInputStream, - request.bodyInputStream.available()); let blob = processUpdateRequest(); response.setHeader("Content-Type", "application/vnd.google.safebrowsing-update", false); diff --git a/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js b/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js index 92dc1559fed9..7f94d1520435 100644 --- a/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js +++ b/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js @@ -162,8 +162,6 @@ function processUpdateRequest() { function waitForUpdates() { let deferred = Promise.defer(); gHttpServer.registerPathHandler("/downloads", function(request, response) { - let buf = NetUtil.readInputStreamToString(request.bodyInputStream, - request.bodyInputStream.available()); let blob = processUpdateRequest(); response.setHeader("Content-Type", "application/vnd.google.safebrowsing-update", false); diff --git a/toolkit/components/downloads/test/unit/test_app_rep_windows.js b/toolkit/components/downloads/test/unit/test_app_rep_windows.js index 6123a2cdba79..4ff772e61193 100644 --- a/toolkit/components/downloads/test/unit/test_app_rep_windows.js +++ b/toolkit/components/downloads/test/unit/test_app_rep_windows.js @@ -262,8 +262,6 @@ function processUpdateRequest() { function waitForUpdates() { let deferred = Promise.defer(); gHttpServer.registerPathHandler("/downloads", function(request, response) { - let buf = NetUtil.readInputStreamToString(request.bodyInputStream, - request.bodyInputStream.available()); let blob = processUpdateRequest(); response.setHeader("Content-Type", "application/vnd.google.safebrowsing-update", false); diff --git a/toolkit/components/feeds/FeedProcessor.js b/toolkit/components/feeds/FeedProcessor.js index da5c4e3ffdca..00969fe13fc5 100644 --- a/toolkit/components/feeds/FeedProcessor.js +++ b/toolkit/components/feeds/FeedProcessor.js @@ -970,8 +970,6 @@ ExtensionHandler.prototype = { }, startElement: function EH_startElement(uri, localName, qName, attrs) { ++this._depth; - var prefix = gNamespaces[uri] ? gNamespaces[uri] + ":" : ""; - var key = prefix + localName; if (this._depth == 1) { this._uri = uri; @@ -1498,7 +1496,7 @@ FeedProcessor.prototype = { // attributes and child elements. _processComplexElement: function FP__processComplexElement(elementInfo, attributes) { - var obj, key, prefix; + var obj; // If the container is an entry/item, it'll need to have its // more esoteric properties put in the 'fields' property bag. diff --git a/toolkit/components/filepicker/content/filepicker.js b/toolkit/components/filepicker/content/filepicker.js index 5b1fb4b84757..6f91066ba520 100644 --- a/toolkit/components/filepicker/content/filepicker.js +++ b/toolkit/components/filepicker/content/filepicker.js @@ -661,9 +661,7 @@ function newDir() { var parent = file.parent; if (!(parent.exists() && parent.isDirectory() && parent.isWritable())) { - var oldParent = parent; while (!parent.exists()) { - oldParent = parent; parent = parent.parent; } if (parent.isFile()) { diff --git a/toolkit/components/filepicker/nsFilePicker.js b/toolkit/components/filepicker/nsFilePicker.js index 6ba0acaa02d3..8c92ff821bc7 100644 --- a/toolkit/components/filepicker/nsFilePicker.js +++ b/toolkit/components/filepicker/nsFilePicker.js @@ -270,17 +270,6 @@ nsFilePicker.prototype = { } } - var parentWin = null; - try { - parentWin = parent.QueryInterface(nsIInterfaceRequestor) - .getInterface(nsIWebNavigation) - .QueryInterface(nsIDocShellTreeItem) - .treeOwner - .QueryInterface(nsIInterfaceRequestor) - .getInterface(nsIBaseWindow); - } catch (ex) { - dump("file picker couldn't get base window\n"+ex+"\n"); - } try { parent.openDialog("chrome://global/content/filepicker.xul", "", @@ -328,4 +317,3 @@ function srGetStrBundle(path) } return strBundle; } - diff --git a/toolkit/components/gfx/SanityTest.js b/toolkit/components/gfx/SanityTest.js index d07c083373c2..a563ec361914 100644 --- a/toolkit/components/gfx/SanityTest.js +++ b/toolkit/components/gfx/SanityTest.js @@ -180,7 +180,6 @@ var listener = { }, receiveMessage(message) { - let data = message.data; switch (message.name) { case "gfxSanity:ContentLoaded": this.runSanityTest(); @@ -244,7 +243,6 @@ SanityTest.prototype = { shouldRunTest: function() { // Only test gfx features if firefox has updated, or if the user has a new // gpu or drivers. - var appInfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo); var buildId = Services.appinfo.platformBuildID; var gfxinfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo); diff --git a/toolkit/components/jsdownloads/test/unit/common_test_Download.js b/toolkit/components/jsdownloads/test/unit/common_test_Download.js index 59dafee96e3d..54b678a0816a 100644 --- a/toolkit/components/jsdownloads/test/unit/common_test_Download.js +++ b/toolkit/components/jsdownloads/test/unit/common_test_Download.js @@ -2380,11 +2380,11 @@ add_task(function* test_platform_integration() let download; if (gUseLegacySaver) { download = yield promiseStartLegacyDownload(httpUrl("source.txt"), - { targetFile: targetFile }); + { isPrivate, targetFile }); } else { download = yield Downloads.createDownload({ - source: httpUrl("source.txt"), + source: { url: httpUrl("source.txt"), isPrivate }, target: targetFile, }); download.start().catch(() => {}); diff --git a/toolkit/components/jsdownloads/test/unit/head.js b/toolkit/components/jsdownloads/test/unit/head.js index ea996f4d2469..f322244c4815 100644 --- a/toolkit/components/jsdownloads/test/unit/head.js +++ b/toolkit/components/jsdownloads/test/unit/head.js @@ -820,11 +820,6 @@ add_task(function test_common_initialize() }, })); - // Get a reference to nsIComponentRegistrar, and ensure that is is freed - // before the XPCOM shutdown. - let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); - do_register_cleanup(() => registrar = null); - // Make sure that downloads started using nsIExternalHelperAppService are // saved to disk without asking for a destination interactively. let mock = { diff --git a/toolkit/components/jsdownloads/test/unit/test_DownloadIntegration.js b/toolkit/components/jsdownloads/test/unit/test_DownloadIntegration.js index 21e2de3c516f..31dd7c7a4a03 100644 --- a/toolkit/components/jsdownloads/test/unit/test_DownloadIntegration.js +++ b/toolkit/components/jsdownloads/test/unit/test_DownloadIntegration.js @@ -408,7 +408,7 @@ add_task(function* test_exit_private_browsing() let download1 = yield promiseNewDownload(httpUrl("source.txt")); let download2 = yield promiseNewDownload(httpUrl("interruptible.txt")); let promiseAttempt1 = download1.start(); - let promiseAttempt2 = download2.start(); + download2.start(); // Add downloads to list. yield privateList.add(download1); diff --git a/toolkit/components/jsdownloads/test/unit/test_DownloadStore.js b/toolkit/components/jsdownloads/test/unit/test_DownloadStore.js index 0226596040df..3a23dfbe361c 100644 --- a/toolkit/components/jsdownloads/test/unit/test_DownloadStore.js +++ b/toolkit/components/jsdownloads/test/unit/test_DownloadStore.js @@ -111,7 +111,7 @@ add_task(function* test_save_reload() */ add_task(function* test_save_empty() { - let [list, store] = yield promiseNewListAndStore(); + let [, store] = yield promiseNewListAndStore(); let createdFile = yield OS.File.open(store.path, { create: true }); yield createdFile.close(); diff --git a/toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js b/toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js index a94f4b89eadc..ce30a5c1ba18 100644 --- a/toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js +++ b/toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js @@ -56,7 +56,7 @@ var listener = { var bis = Components.classes["@mozilla.org/binaryinputstream;1"] .createInstance(Components.interfaces.nsIBinaryInputStream); bis.setInputStream(stream); - var array = bis.readByteArray(bis.available()); + bis.readByteArray(bis.available()); } catch (ex) { do_throw("Error in onDataAvailable: " + ex); } @@ -88,7 +88,6 @@ function runNext() { } function getFileContents(aFile) { - const PR_RDONLY = 0x01; var fileStream = Cc["@mozilla.org/network/file-input-stream;1"] .createInstance(Ci.nsIFileInputStream); fileStream.init(aFile, 1, -1, null); diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_AddonWatcher.js b/toolkit/components/perfmonitoring/tests/browser/browser_AddonWatcher.js index e0bb14774542..b4e80faa7af4 100644 --- a/toolkit/components/perfmonitoring/tests/browser/browser_AddonWatcher.js +++ b/toolkit/components/perfmonitoring/tests/browser/browser_AddonWatcher.js @@ -41,15 +41,6 @@ add_task(function* init() { addon.uninstall() }); - - let freezeThreshold = Preferences.get("browser.addon-watch.freeze-threshold-micros", /* 5 seconds */ 5000000); - let jankThreshold = Preferences.get("browser.addon-watch.jank-threshold-micros", /* 256 ms == 8 frames*/ 256000); - let occurrencesBetweenAlerts = Preferences.get("browser.addon-watch.occurrences-between-alerts", 3); - let delayBetweenAlerts = Preferences.get("browser.addon-watch.delay-between-alerts-ms", 6 * 3600 * 1000 /* 6h */); - let delayBetweenFreezeAlerts = Preferences.get("browser.addon-watch.delay-between-freeze-alerts-ms", 2 * 60 * 1000 /* 2 min */); - let prescriptionDelay = Preferences.get("browser.addon-watch.prescription-delay", 5 * 60 * 1000 /* 5 minutes */); - let highestNumberOfAddonsToReport = Preferences.get("browser.addon-watch.max-simultaneous-reports", 1); - Preferences.set("browser.addon-watch.warmup-ms", 0); Preferences.set("browser.addon-watch.freeze-threshold-micros", 0); Preferences.set("browser.addon-watch.jank-threshold-micros", 0); diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_compartments.js b/toolkit/components/perfmonitoring/tests/browser/browser_compartments.js index 268b0636bf70..f04fefb339d7 100644 --- a/toolkit/components/perfmonitoring/tests/browser/browser_compartments.js +++ b/toolkit/components/perfmonitoring/tests/browser/browser_compartments.js @@ -27,9 +27,6 @@ function frameScript() { const { utils: Cu, classes: Cc, interfaces: Ci } = Components; Cu.import("resource://gre/modules/PerformanceStats.jsm"); Cu.import("resource://gre/modules/Services.jsm"); - let performanceStatsService = - Cc["@mozilla.org/toolkit/performance-stats-service;1"]. - getService(Ci.nsIPerformanceStatsService); // Make sure that the stopwatch is now active. let monitor = PerformanceStats.getMonitor(["jank", "cpow", "ticks", "compartments"]); diff --git a/toolkit/components/printing/content/printjoboptions.js b/toolkit/components/printing/content/printjoboptions.js index 4e4c88d21134..26f3ffd8543e 100644 --- a/toolkit/components/printing/content/printjoboptions.js +++ b/toolkit/components/printing/content/printjoboptions.js @@ -135,8 +135,6 @@ function createPaperArrayFromDefaults() var paperWidths = [ 8.5, 8.5, 7.25, 148.0, 210.0, 287.0, 420.0, 594.0, 841.0]; var paperHeights = [11.0, 14.0, 10.50, 210.0, 297.0, 420.0, 594.0, 841.0, 1189.0]; var paperInches = [true, true, true, false, false, false, false, false, false]; - // this is deprecated - var paperEnums = [0, 1, 2, 3, 4, 5, 6, 7, 8]; gPaperArray = new Array(); diff --git a/toolkit/components/promiseworker/PromiseWorker.jsm b/toolkit/components/promiseworker/PromiseWorker.jsm index d5778a192bdf..0c6e054a28ee 100644 --- a/toolkit/components/promiseworker/PromiseWorker.jsm +++ b/toolkit/components/promiseworker/PromiseWorker.jsm @@ -305,14 +305,12 @@ this.BasePromiseWorker.prototype = { this.log("Message posted"); let reply; - let isError = false; try { this.log("Expecting reply"); reply = yield deferred.promise; } catch (error) { this.log("Got error", error); reply = error; - isError = true; if (error instanceof WorkerError) { // We know how to deserialize most well-known errors diff --git a/toolkit/components/prompts/content/selectDialog.js b/toolkit/components/prompts/content/selectDialog.js index 689f42d53de1..7628dc8d96cb 100644 --- a/toolkit/components/prompts/content/selectDialog.js +++ b/toolkit/components/prompts/content/selectDialog.js @@ -56,7 +56,6 @@ function dialogOnLoad() { } function dialogOK() { - let selected = listBox.selectedIndex; gArgs.setProperty("selected", listBox.selectedIndex); gArgs.setProperty("ok", true); return true; diff --git a/toolkit/components/prompts/content/tabprompts.xml b/toolkit/components/prompts/content/tabprompts.xml index c2f110e4eb0d..07c6c8efbc0b 100644 --- a/toolkit/components/prompts/content/tabprompts.xml +++ b/toolkit/components/prompts/content/tabprompts.xml @@ -300,7 +300,6 @@ event.stopPropagation(); if (action == "default") { let bnum = this.args.defaultButtonNum || 0; - let button = this.ui["button" + bnum]; this.onButtonClick(bnum); } else { // action == "cancel" this.onButtonClick(1); // Cancel button diff --git a/toolkit/components/satchel/FormHistory.jsm b/toolkit/components/satchel/FormHistory.jsm index 435af1d61eb2..3d4a9fc436a0 100644 --- a/toolkit/components/satchel/FormHistory.jsm +++ b/toolkit/components/satchel/FormHistory.jsm @@ -782,7 +782,6 @@ this.FormHistory = { let handlers = { handleResult : function(aResultSet) { - let formHistoryFields = dbSchema.tables.moz_formhistory; for (let row = aResultSet.getNextRow(); row; row = aResultSet.getNextRow()) { let result = {}; for (let field of aSelectTerms) { diff --git a/toolkit/components/satchel/nsFormHistory.js b/toolkit/components/satchel/nsFormHistory.js index d43d831e4cb3..d68be2d5870d 100644 --- a/toolkit/components/satchel/nsFormHistory.js +++ b/toolkit/components/satchel/nsFormHistory.js @@ -303,7 +303,7 @@ FormHistory.prototype = { entryExists : function entryExists(name, value) { this.log("entryExists for " + name + "=" + value); - let [id, guid] = this.getExistingEntryID(name, value); + let [id] = this.getExistingEntryID(name, value); this.log("entryExists: id=" + id); return (id != -1); }, diff --git a/toolkit/components/satchel/test/test_bug_511615.html b/toolkit/components/satchel/test/test_bug_511615.html index c2017e2bfc75..66972d9b30ef 100644 --- a/toolkit/components/satchel/test/test_bug_511615.html +++ b/toolkit/components/satchel/test/test_bug_511615.html @@ -74,7 +74,7 @@ function checkSelectedIndexAfterResponseTime(expectedIndex) { function doKeyUnprivileged(key) { let keyName = "DOM_VK_" + key.toUpperCase(); - let keycode, charcode, alwaysVal; + let keycode, charcode; if (key.length == 1) { keycode = 0; diff --git a/toolkit/components/satchel/test/unit/test_notify.js b/toolkit/components/satchel/test/unit/test_notify.js index 962d49bb571f..556ecd4b08c5 100644 --- a/toolkit/components/satchel/test/unit/test_notify.js +++ b/toolkit/components/satchel/test/unit/test_notify.js @@ -54,8 +54,6 @@ var testnum = 0; var testdesc = "Setup of test form history entries"; var entry1 = ["entry1", "value1"]; -var entry2 = ["entry2", "value2"]; - /* ========== 1 ========== */ testnum = 1; diff --git a/toolkit/components/search/tests/xpcshell/head_search.js b/toolkit/components/search/tests/xpcshell/head_search.js index 5c07477c3d24..2f40d84f86f3 100644 --- a/toolkit/components/search/tests/xpcshell/head_search.js +++ b/toolkit/components/search/tests/xpcshell/head_search.js @@ -59,8 +59,6 @@ function dumpn(text) */ function configureToLoadJarEngines() { - let defaultBranch = Services.prefs.getDefaultBranch(null); - let url = "chrome://testsearchplugin/locale/searchplugins/"; let resProt = Services.io.getProtocolHandler("resource") .QueryInterface(Ci.nsIResProtocolHandler); diff --git a/toolkit/components/search/tests/xpcshell/test_identifiers.js b/toolkit/components/search/tests/xpcshell/test_identifiers.js index 00e5384fd062..0d5ca5b90b95 100644 --- a/toolkit/components/search/tests/xpcshell/test_identifiers.js +++ b/toolkit/components/search/tests/xpcshell/test_identifiers.js @@ -31,7 +31,7 @@ add_test(function test_identifier() { let engineTemplateFile = do_get_file("data/engine.xml"); engineTemplateFile.copyTo(engineFile.parent, "test-search-engine.xml"); - let search = Services.search.init(function initComplete(aResult) { + Services.search.init(function initComplete(aResult) { do_print("init'd search service"); do_check_true(Components.isSuccessCode(aResult)); diff --git a/toolkit/components/search/tests/xpcshell/test_json_cache.js b/toolkit/components/search/tests/xpcshell/test_json_cache.js index b505ce1d46d2..c804b0bca599 100644 --- a/toolkit/components/search/tests/xpcshell/test_json_cache.js +++ b/toolkit/components/search/tests/xpcshell/test_json_cache.js @@ -58,7 +58,6 @@ function run_test() { uri: "resource://search-plugins/list.json", loadUsingSystemPrincipal: true }); - let visibleDefaultEngines = []; let sis = Cc["@mozilla.org/scriptableinputstream;1"]. createInstance(Ci.nsIScriptableInputStream); sis.init(chan.open2()); @@ -83,7 +82,7 @@ add_test(function prepare_test_data() { add_test(function test_cached_engine_properties() { do_print("init search service"); - let search = Services.search.init(function initComplete(aResult) { + Services.search.init(function initComplete(aResult) { do_print("init'd search service"); do_check_true(Components.isSuccessCode(aResult)); diff --git a/toolkit/components/search/tests/xpcshell/test_location_sync.js b/toolkit/components/search/tests/xpcshell/test_location_sync.js index 16dc410b0865..524a440fbd58 100644 --- a/toolkit/components/search/tests/xpcshell/test_location_sync.js +++ b/toolkit/components/search/tests/xpcshell/test_location_sync.js @@ -55,7 +55,7 @@ add_task(function* test_simple() { // fetching the engines forces a sync init, and should have caused us to // check the timezone. - let engines = Services.search.getEngines(); + Services.search.getEngines(); ok(Services.search.isInitialized); // a little wait to check we didn't do the xhr thang. diff --git a/toolkit/components/search/tests/xpcshell/test_sync_migration.js b/toolkit/components/search/tests/xpcshell/test_sync_migration.js index 0828f01bcc47..53e945dfd8ae 100644 --- a/toolkit/components/search/tests/xpcshell/test_sync_migration.js +++ b/toolkit/components/search/tests/xpcshell/test_sync_migration.js @@ -15,7 +15,7 @@ function run_test() { add_task(function* test_sync_metadata_migration() { do_check_false(Services.search.isInitialized); - let engines = Services.search.getEngines(); + Services.search.getEngines(); do_check_true(Services.search.isInitialized); yield promiseAfterCache(); diff --git a/toolkit/components/telemetry/tests/unit/test_ChildHistograms.js b/toolkit/components/telemetry/tests/unit/test_ChildHistograms.js index 135b56cc18e5..11d730499e7b 100644 --- a/toolkit/components/telemetry/tests/unit/test_ChildHistograms.js +++ b/toolkit/components/telemetry/tests/unit/test_ChildHistograms.js @@ -85,7 +85,7 @@ add_task(function*() { } // Run test in child, don't wait for it to finish. - let childPromise = run_test_in_child("test_ChildHistograms.js"); + run_test_in_child("test_ChildHistograms.js"); yield do_await_remote_message(MESSAGE_CHILD_TEST_DONE); yield ContentTaskUtils.waitForCondition(() => { diff --git a/toolkit/components/telemetry/tests/unit/test_PingAPI.js b/toolkit/components/telemetry/tests/unit/test_PingAPI.js index 002f3bd77e66..d4d79aad4e8e 100644 --- a/toolkit/components/telemetry/tests/unit/test_PingAPI.js +++ b/toolkit/components/telemetry/tests/unit/test_PingAPI.js @@ -106,7 +106,6 @@ add_task(function* test_archivedPings() { } // Check loading the archived pings. - let ids = PINGS.map(p => p.id); let checkLoadingPings = Task.async(function*() { for (let data of PINGS) { let ping = yield TelemetryArchive.promiseArchivedPingById(data.id); @@ -263,7 +262,7 @@ add_task(function* test_archiveCleanup() { Telemetry.getHistogramById("TELEMETRY_ARCHIVE_OLDEST_DIRECTORY_AGE").clear(); // Move the current date 60 days ahead of the first ping. - let now = fakeNow(futureDate(firstDate, 60 * MILLISECONDS_PER_DAY)); + fakeNow(futureDate(firstDate, 60 * MILLISECONDS_PER_DAY)); // Reset TelemetryArchive and TelemetryController to start the startup cleanup. yield TelemetryController.testReset(); // Wait for the cleanup to finish. diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryController.js b/toolkit/components/telemetry/tests/unit/test_TelemetryController.js index ebfe9f954bf3..b383de6bf1bf 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryController.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryController.js @@ -287,9 +287,6 @@ add_task(function* test_pingHasEnvironmentAndClientId() { }); add_task(function* test_archivePings() { - const ARCHIVE_PATH = - OS.Path.join(OS.Constants.Path.profileDir, "datareporting", "archived"); - let now = new Date(2009, 10, 18, 12, 0, 0); fakeNow(now); diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js index 884f8e313f39..35181272ae48 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js @@ -944,7 +944,6 @@ add_task(function* test_addonsWatch_InterestingChange() { // We only expect a single notification for each install, uninstall, enable, disable. const EXPECTED_NOTIFICATIONS = 4; - let deferred = PromiseUtils.defer(); let receivedNotifications = 0; let registerCheckpointPromise = (aExpected) => { @@ -1266,7 +1265,6 @@ add_task(function* test_collectionWithbrokenAddonData() { AddonManager.SIGNEDSTATE_NOT_REQUIRED, }; - let deferred = PromiseUtils.defer(); let receivedNotifications = 0; let registerCheckpointPromise = (aExpected) => { diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js b/toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js index d2c9e5d8b54e..68606a98e362 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js @@ -192,7 +192,7 @@ add_task(function* test_userNotifiedOfCurrentPolicy() { "The default state of the date should have a time of 0 and it should therefore fail"); // Showing the notification bar should make the user notified. - let now = fakeNow(2012, 11, 11); + fakeNow(2012, 11, 11); TelemetryReportingPolicy.testInfobarShown(); Assert.ok(TelemetryReportingPolicy.testIsUserNotified(), "Using the proper API causes user notification to report as true."); diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js b/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js index b41ddc5300bd..f34035cc3374 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js @@ -177,7 +177,7 @@ add_task(function* test_sendPendingPings() { }); add_task(function* test_sendDateHeader() { - let now = fakeNow(new Date(Date.UTC(2011, 1, 1, 11, 0, 0))); + fakeNow(new Date(Date.UTC(2011, 1, 1, 11, 0, 0))); yield TelemetrySend.reset(); let pingId = yield TelemetryController.submitExternalPing("test-send-date-header", {}); diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js b/toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js index 438f2fcf8e69..221b6bcab7d1 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js @@ -178,7 +178,7 @@ add_task(function* setupEnvironment() { */ add_task(function* test_recent_pings_sent() { let pingTypes = [{ num: RECENT_PINGS }]; - let recentPings = yield createSavedPings(pingTypes); + yield createSavedPings(pingTypes); yield TelemetryController.testReset(); yield TelemetrySend.testWaitOnOutgoingPings(); diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js index c043c476f027..cd9501e81656 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js @@ -1104,9 +1104,6 @@ add_task(function* test_environmentChange() { return; } - let timerCallback = null; - let timerDelay = null; - yield TelemetryStorage.testClearPendingPings(); PingServer.clearRequests(); @@ -1245,8 +1242,8 @@ add_task(function* test_savedSessionData() { // Watch a test preference, trigger and environment change and wait for it to propagate. // _watchPreferences triggers a subsession notification - let now = fakeNow(new Date(2050, 1, 1, 12, 0, 0)); gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE); + fakeNow(new Date(2050, 1, 1, 12, 0, 0)); TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH); let changePromise = new Promise(resolve => TelemetryEnvironment.registerChangeListener("test_fake_change", resolve)); @@ -1468,7 +1465,7 @@ add_task(function* test_abortedSession_Shutdown() { "Telemetry must create the aborted session directory when starting."); // Fake now again so that the scheduled aborted-session save takes place. - now = fakeNow(futureDate(now, ABORTED_SESSION_UPDATE_INTERVAL_MS)); + fakeNow(futureDate(now, ABORTED_SESSION_UPDATE_INTERVAL_MS)); // The first aborted session checkpoint must take place right after the initialisation. Assert.ok(!!schedulerTickCallback); // Execute one scheduler tick. @@ -1619,7 +1616,7 @@ add_task(function* test_schedulerEnvironmentReschedules() { TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH); // Set the current time at midnight. - let future = fakeNow(futureDate(nowDate, MS_IN_ONE_DAY)); + fakeNow(futureDate(nowDate, MS_IN_ONE_DAY)); gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE); // Trigger the environment change. @@ -1906,7 +1903,7 @@ add_task(function* test_changeThrottling() { Assert.equal(getSubsessionCount(), 1); // We should get a change notification after the 5min throttling interval. - now = fakeNow(futureDate(now, 5 * MILLISECONDS_PER_MINUTE + 1)); + fakeNow(futureDate(now, 5 * MILLISECONDS_PER_MINUTE + 1)); gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 5 * MILLISECONDS_PER_MINUTE + 1); Preferences.set(PREF_TEST, 2); Assert.equal(getSubsessionCount(), 2); diff --git a/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js b/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js index 5cf4ccf6da23..8dc5526043d1 100644 --- a/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js +++ b/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js @@ -145,10 +145,8 @@ add_task(function* test_boolean_histogram() { var r = h.snapshot().ranges; // boolean histograms ignore numeric parameters do_check_eq(uneval(r), uneval([0, 1, 2])) - var sum = 0 for (var i=0;i PageThumbsStorage.getLeafNameForURL(url)); let msg = [ PageThumbsStorage.path, diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_storage_migrate3.js b/toolkit/components/thumbnails/test/browser_thumbnails_storage_migrate3.js index 7eec58928384..e7f150f87174 100644 --- a/toolkit/components/thumbnails/test/browser_thumbnails_storage_migrate3.js +++ b/toolkit/components/thumbnails/test/browser_thumbnails_storage_migrate3.js @@ -22,14 +22,10 @@ XPCOMUtils.defineLazyServiceGetter(this, "gDirSvc", * directory and should just apply to Linux. */ function* runTests() { - let dirSvc = Cc["@mozilla.org/file/directory_service;1"] - .getService(Ci.nsIProperties); - // Prepare a local profile directory. let localProfile = FileUtils.getDir("ProfD", ["local-test"], true); changeLocation("ProfLD", localProfile); - let local = FileUtils.getDir("ProfLD", [THUMBNAIL_DIRECTORY], true); let roaming = FileUtils.getDir("ProfD", [THUMBNAIL_DIRECTORY], true); // Set up some data in the roaming profile. diff --git a/toolkit/components/tooltiptext/tests/browser_bug581947.js b/toolkit/components/tooltiptext/tests/browser_bug581947.js index 97c505d3d50f..034e0a4d13b1 100644 --- a/toolkit/components/tooltiptext/tests/browser_bug581947.js +++ b/toolkit/components/tooltiptext/tests/browser_bug581947.js @@ -1,6 +1,5 @@ function check(aBrowser, aElementName, aBarred, aType) { return ContentTask.spawn(aBrowser, [aElementName, aBarred, aType], function*([aElementName, aBarred, aType]) { - let doc = content.document; let e = content.document.createElement(aElementName); let contentElement = content.document.getElementById('content'); contentElement.appendChild(e); @@ -39,7 +38,6 @@ function check(aBrowser, aElementName, aBarred, aType) { function todo_check(aBrowser, aElementName, aBarred) { return ContentTask.spawn(aBrowser, [aElementName, aBarred], function*([aElementName, aBarred]) { - let doc = content.document; let e = content.document.createElement(aElementName); let contentElement = content.document.getElementById('content'); contentElement.appendChild(e); @@ -87,4 +85,3 @@ add_task(function*() { } }); }); - diff --git a/toolkit/components/viewsource/content/viewSource-content.js b/toolkit/components/viewsource/content/viewSource-content.js index fe6f5b64635e..d1dfc2579563 100644 --- a/toolkit/components/viewsource/content/viewSource-content.js +++ b/toolkit/components/viewsource/content/viewSource-content.js @@ -237,8 +237,8 @@ var ViewSourceContent = { let utils = requestor.getInterface(Ci.nsIDOMWindowUtils); let doc = contentWindow.document; - let forcedCharSet = utils.docCharsetIsForced ? doc.characterSet - : null; + forcedCharSet = utils.docCharsetIsForced ? doc.characterSet + : null; } this.loadSource(URL, pageDescriptor, lineNumber, forcedCharSet); @@ -289,7 +289,6 @@ var ViewSourceContent = { */ loadSource(URL, pageDescriptor, lineNumber, forcedCharSet) { const viewSrcURL = "view-source:" + URL; - let loadFromURL = false; if (forcedCharSet) { docShell.charset = forcedCharSet; diff --git a/toolkit/components/viewsource/content/viewSourceUtils.js b/toolkit/components/viewsource/content/viewSourceUtils.js index 8e7cf3112ce6..5752683e9956 100644 --- a/toolkit/components/viewsource/content/viewSourceUtils.js +++ b/toolkit/components/viewsource/content/viewSourceUtils.js @@ -127,7 +127,6 @@ var gViewSourceUtils = { message.data.baseURI); } else { - let docUrl = null; window.openDialog("chrome://global/content/viewPartialSource.xul", "_blank", "all,dialog=no", { diff --git a/toolkit/components/viewsource/test/browser/browser_gotoline.js b/toolkit/components/viewsource/test/browser/browser_gotoline.js index 268097545e9c..5bb45f9caf9d 100644 --- a/toolkit/components/viewsource/test/browser/browser_gotoline.js +++ b/toolkit/components/viewsource/test/browser/browser_gotoline.js @@ -19,7 +19,6 @@ add_task(function*() { var checkViewSource = Task.async(function* (aWindow) { is(aWindow.gBrowser.contentDocument.body.textContent, content, "Correct content loaded"); - let selection = aWindow.gBrowser.contentWindow.getSelection(); let statusPanel = aWindow.document.getElementById("statusbar-line-col"); is(statusPanel.getAttribute("label"), "", "Correct status bar text"); diff --git a/toolkit/components/workerloader/require.js b/toolkit/components/workerloader/require.js index 0b1c4375e07e..223132f7e94f 100644 --- a/toolkit/components/workerloader/require.js +++ b/toolkit/components/workerloader/require.js @@ -121,8 +121,6 @@ } modules.set(path, module); - let name = ":" + path; - let objectURL; try { // Load source of module, synchronously let xhr = new XMLHttpRequest();