Bug 1314918 - Fix most of the remaining no-unused-vars issues for local scope in browser/. r=mossop

MozReview-Commit-ID: LdoXLniNeT7

--HG--
extra : rebase_source : d2418b8cfab0a399d0dfb5a96ea50c62fac63e70
This commit is contained in:
Mark Banner 2016-11-03 11:51:48 +00:00
Родитель eb9572c272
Коммит a41b5adcb0
74 изменённых файлов: 83 добавлений и 158 удалений

Просмотреть файл

@ -4,4 +4,12 @@ module.exports = {
"extends": [
"../toolkit/.eslintrc.js"
],
"rules": {
"no-unused-vars": ["error", {
"vars": "local",
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
"args": "none",
}]
}
};

Просмотреть файл

@ -117,7 +117,7 @@ add_task(function* test() {
let res = {};
// Insert the media key.
let result = yield new Promise(resolve => {
yield new Promise(resolve => {
session.addEventListener("message", function(event) {
session.update(aKeyInfo.keyObj).then(
() => { resolve(); }

Просмотреть файл

@ -113,7 +113,6 @@ add_task(function* test() {
// Load the page in 3 different contexts and set a cookie
// which should only be visible in that context.
let value = USER_CONTEXTS[userContextId];
// Open our tab in the given user context.
let tabInfo = yield* openTabInUserContext(testURL, userContextId);

Просмотреть файл

@ -107,7 +107,7 @@ function* setupEMEKey(browser) {
let res = {};
// Insert the EME key.
let result = yield new Promise(resolve => {
yield new Promise(resolve => {
session.addEventListener("message", function(event) {
session.update(aKeyInfo.keyObj).then(
() => { resolve(); }

Просмотреть файл

@ -87,7 +87,7 @@ function* checkIndexedDB(browser) {
});
try {
let transaction = db.transaction(["obj"], "readonly");
db.transaction(["obj"], "readonly");
ok(false, "The indexedDB should not exist");
} catch (e) {
is(e.name, "NotFoundError", "The indexedDB does not exist as expected");
@ -145,4 +145,3 @@ add_task(function* test_quota_clearStoragesForPrincipal() {
yield BrowserTestUtils.removeTab(tabs[userContextId].tab);
}
});

Просмотреть файл

@ -180,8 +180,8 @@ function* test_cache_cleared() {
// Check that caches have been set correctly.
for (let userContextId of Object.keys(USER_CONTEXTS)) {
let mem = getCacheStorage("memory");
let disk = getCacheStorage("disk");
let mem = getCacheStorage("memory", LoadContextInfo.custom(false, {userContextId}));
let disk = getCacheStorage("disk", LoadContextInfo.custom(false, {userContextId}));
Assert.ok(mem.exists(createURI("http://" + TEST_HOST + "/"), ""), "The memory cache has been set correctly");
Assert.ok(disk.exists(createURI("http://" + TEST_HOST + "/"), ""), "The disk cache has been set correctly");
@ -192,8 +192,8 @@ function* test_cache_cleared() {
// Check that do caches be removed or not?
for (let userContextId of Object.keys(USER_CONTEXTS)) {
let mem = getCacheStorage("memory");
let disk = getCacheStorage("disk");
let mem = getCacheStorage("memory", LoadContextInfo.custom(false, {userContextId}));
let disk = getCacheStorage("disk", LoadContextInfo.custom(false, {userContextId}));
Assert.ok(!mem.exists(createURI("http://" + TEST_HOST + "/"), ""), "The memory cache is cleared");
Assert.ok(!disk.exists(createURI("http://" + TEST_HOST + "/"), ""), "The disk cache is cleared");
@ -304,7 +304,7 @@ function* test_storage_cleared() {
};
});
try {
let transaction = db.transaction(["obj"], "readonly");
db.transaction(["obj"], "readonly");
Assert.ok(false, "The indexedDB should not exist");
} catch (e) {
Assert.equal(e.name, "NotFoundError", "The indexedDB does not exist as expected");

Просмотреть файл

@ -14,7 +14,7 @@ add_task(function* () {
yield BrowserTestUtils.browserLoaded(browser);
info("Create a HTMLAnchorElement...");
let position = yield ContentTask.spawn(browser, URI,
yield ContentTask.spawn(browser, URI,
function(URI) {
let anchor = content.document.createElement("a");
anchor.setAttribute('id', 'clickMe');

Просмотреть файл

@ -334,7 +334,7 @@ var CustomizableUIInternal = {
// because the per-widget pref facility is independent of versioning.
if (!gSavedState) {
// Flip all the prefs so we don't try to re-introduce later:
for (let [id, widget] of gPalette) {
for (let [, widget] of gPalette) {
if (widget.defaultArea && widget._introducedInVersion === "pref") {
let prefId = "browser.toolbarbuttons.introduced." + widget.id;
Services.prefs.setBoolPref(prefId, true);
@ -610,7 +610,6 @@ var CustomizableUIInternal = {
if (gBuildAreas.has(area) && gBuildAreas.get(area).has(aToolbar)) {
return;
}
let document = aToolbar.ownerDocument;
let areaProperties = gAreas.get(area);
// If this area is not registered, try to do it automatically:
@ -1079,7 +1078,7 @@ var CustomizableUIInternal = {
this.notifyListeners("onWidgetInstanceRemoved", widget.id, document);
}
for (let [area, areaMap] of gPendingBuildAreas) {
for (let [, areaMap] of gPendingBuildAreas) {
let toDelete = [];
for (let [areaNode, ] of areaMap) {
if (areaNode.ownerDocument == document) {
@ -1087,7 +1086,7 @@ var CustomizableUIInternal = {
}
}
for (let areaNode of toDelete) {
areaMap.delete(toDelete);
areaMap.delete(areaNode);
}
}
@ -2184,7 +2183,7 @@ var CustomizableUIInternal = {
// Look through previously saved state to see if we're restoring a widget.
let seenAreas = new Set();
let widgetMightNeedAutoAdding = true;
for (let [area, placements] of gPlacements) {
for (let [area, ] of gPlacements) {
seenAreas.add(area);
let areaIsRegistered = gAreas.has(area);
let index = gPlacements.get(area).indexOf(widget.id);

Просмотреть файл

@ -484,7 +484,6 @@ const CustomizableWidgets = [
}
},
_createTabElement(doc, tabInfo) {
let win = doc.defaultView;
let item = doc.createElementNS(kNSXUL, "toolbarbutton");
let tooltipText = (tabInfo.title ? tabInfo.title + "\n" : "") + tabInfo.url;
item.setAttribute("itemtype", "tab");
@ -549,7 +548,6 @@ const CustomizableWidgets = [
// sidebar menu. We skip menu elements, because the menu panel has no way
// of dealing with those right now.
let doc = aEvent.target.ownerDocument;
let win = doc.defaultView;
let menu = doc.getElementById("viewSidebarMenu");
// First clear any existing menuitems then populate. Add it to the

Просмотреть файл

@ -42,7 +42,6 @@ let gDebug;
XPCOMUtils.defineLazyGetter(this, "log", () => {
let scope = {};
Cu.import("resource://gre/modules/Console.jsm", scope);
let ConsoleAPI = scope.ConsoleAPI;
try {
gDebug = Services.prefs.getBoolPref(kPrefCustomizationDebug);
} catch (ex) {}
@ -246,7 +245,6 @@ CustomizeMode.prototype = {
let toolbarVisibilityBtn = document.getElementById(kToolbarVisibilityBtn);
let togglableToolbars = window.getTogglableToolbars();
let bookmarksToolbar = document.getElementById("PersonalToolbar");
if (togglableToolbars.length == 0) {
toolbarVisibilityBtn.setAttribute("hidden", "true");
} else {
@ -427,7 +425,6 @@ CustomizeMode.prototype = {
let window = this.window;
let document = this.document;
let documentElement = document.documentElement;
// Hide the palette before starting the transition for increased perf.
this.visiblePalette.hidden = true;
@ -1406,7 +1403,6 @@ CustomizeMode.prototype = {
let footer = doc.getElementById("customization-lwtheme-menu-footer");
let panel = footer.parentNode;
let themesInMyThemesSection = 0;
let recommendedLabel = doc.getElementById("customization-lwtheme-menu-recommended");
for (let theme of themes) {
let button = buildToolbarButton(theme);
@ -1418,7 +1414,6 @@ CustomizeMode.prototype = {
onThemeSelected(panel);
});
panel.insertBefore(button, recommendedLabel);
themesInMyThemesSection++;
}
let lwthemePrefs = Services.prefs.getBranch("lightweightThemes.");

Просмотреть файл

@ -34,7 +34,6 @@ AreaPositionManager.prototype = {
_wideCache: null,
update: function(aContainer) {
let window = aContainer.ownerGlobal;
this._nodePositionStore = new WeakMap();
this._wideCache = new Set();
let last = null;
@ -419,4 +418,3 @@ var DragPositionManager = {
};
Object.freeze(DragPositionManager);

Просмотреть файл

@ -39,7 +39,6 @@ var PanelWideWidgetTracker = {
onWidgetRemoved: function(aWidgetId, aPrevArea) {
if (aPrevArea == gPanel) {
gPanelPlacements = CustomizableUI.getWidgetIdsInArea(gPanel);
let pos = gPanelPlacements.indexOf(aWidgetId);
this.adjustWidgets(aWidgetId, false);
}
},

Просмотреть файл

@ -3,7 +3,7 @@
const BUTTONID = "test-seenwidget-post-reset";
add_task(function*() {
let widget = CustomizableUI.createWidget({
CustomizableUI.createWidget({
id: BUTTONID,
label: "Test widget seen post reset",
defaultArea: CustomizableUI.AREA_NAVBAR

Просмотреть файл

@ -21,9 +21,6 @@ function test() {
is(gFuturePlacements.size, 0,
"No change to future placements initially.");
let currentVersion = CustomizableUIBSPass.kVersion;
// Add our widget to the defaults:
let testWidgetNew = {
id: "test-messing-with-default-placements-new-pref",
@ -79,4 +76,3 @@ function test() {
gPalette.delete(testWidgetNew.id);
CustomizableUI.reset();
}

Просмотреть файл

@ -8,7 +8,6 @@
add_task(function*() {
yield startCustomizing();
let btn = document.getElementById("feed-button");
let panel = document.getElementById(CustomizableUI.AREA_PANEL);
let placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
let lastButtonIndex = placements.length - 1;

Просмотреть файл

@ -117,7 +117,6 @@ add_task(function*() {
let shownPromise = popupShown(contextMenu);
let urlBarContainer = document.getElementById("urlbar-container");
// Need to make sure not to click within an edit field.
let urlbarRect = urlBarContainer.getBoundingClientRect();
EventUtils.synthesizeMouse(urlBarContainer, 100, 1, {type: "contextmenu", button: 2 });
yield shownPromise;

Просмотреть файл

@ -19,7 +19,6 @@ add_task(function*() {
originalWindowWidth = window.outerWidth;
let navbar = document.getElementById(CustomizableUI.AREA_NAVBAR);
ok(!navbar.hasAttribute("overflowing"), "Should start with a non-overflowing toolbar.");
let oldChildCount = navbar.customizationTarget.childElementCount;
window.resizeTo(400, window.outerHeight);
yield waitForCondition(() => navbar.hasAttribute("overflowing"));

Просмотреть файл

@ -8,7 +8,6 @@ const kWidgetId = "test-non-removable-widget";
// Adding non-removable items to a toolbar or the panel shouldn't change inDefaultState
add_task(function() {
let navbar = document.getElementById("nav-bar");
ok(CustomizableUI.inDefaultState, "Should start in default state");
let button = createDummyXULButton(kWidgetId, "Test non-removable inDefaultState handling");

Просмотреть файл

@ -12,7 +12,6 @@ add_task(function*() {
let navbar = document.getElementById(CustomizableUI.AREA_NAVBAR);
ok(!navbar.hasAttribute("overflowing"), "Should start with a non-overflowing toolbar.");
ok(CustomizableUI.inDefaultState, "Should start in default state.");
let oldChildCount = navbar.customizationTarget.childElementCount;
window.resizeTo(400, window.outerHeight);
yield waitForCondition(() => navbar.hasAttribute("overflowing"));
ok(navbar.hasAttribute("overflowing"), "Should have an overflowing toolbar.");

Просмотреть файл

@ -194,10 +194,8 @@ add_task(function* () {
// Test the "Sync Now" button
add_task(function* () {
let nSyncs = 0;
mockedInternal.getTabClients = () => [];
mockedInternal.syncTabs = () => {
nSyncs++;
return Promise.resolve();
}

Просмотреть файл

@ -32,7 +32,6 @@ add_task(function*() {
// move the add-on button in the Panel Menu
CustomizableUI.addWidgetToArea(kButton, CustomizableUI.AREA_PANEL);
let addonButtonInNavbar = navBar.getElementsByAttribute("id", kButton);
ok(!navBar.contains(addonButton), "Addon button was removed from the browser bar");
// check the addon button's functionality in the Panel Menu

Просмотреть файл

@ -62,7 +62,6 @@ function checkPlacesContextMenu(aItemWithContextMenu) {
*/
function checkSpecialContextMenus() {
return Task.spawn(function* () {
let contextMenu = document.getElementById("placesContext");
let bookmarksMenuButton = document.getElementById(kBookmarksButton);
let bookmarksMenuPopup = document.getElementById("BMB_bookmarksPopup");

Просмотреть файл

@ -476,7 +476,6 @@ function popupHidden(aPopup) {
*/
function promisePopupEvent(aPopup, aEventSuffix) {
let deferred = Promise.defer();
let win = aPopup.ownerGlobal;
let eventType = "popup" + aEventSuffix;
function onPopupEvent(e) {

Просмотреть файл

@ -111,7 +111,7 @@ DistributionCustomizer.prototype = {
for (let key of keys) {
let m = re.exec(key);
if (m) {
let [foo, itemIndex, iprop, ilocale] = m;
let [, itemIndex, iprop, ilocale] = m;
itemIndex = parseInt(itemIndex);
if (ilocale)

Просмотреть файл

@ -299,7 +299,9 @@ FeedConverter.prototype = {
request.cancel(Cr.NS_BINDING_ABORTED);
return;
}
let noSniff = httpChannel.getResponseHeader("X-Moz-Is-Feed");
// Note: this throws if the header is not set.
httpChannel.getResponseHeader("X-Moz-Is-Feed");
}
catch (ex) {
this._sniffed = true;

Просмотреть файл

@ -484,10 +484,6 @@ FeedWriter.prototype = {
enclosuresDiv.appendChild(this._document.createTextNode(this._getString("mediaLabel")));
let roundme = function(n) {
return (Math.round(n * 100) / 100).toLocaleString();
}
for (let i_enc = 0; i_enc < entry.enclosures.length; ++i_enc) {
let enc = entry.enclosures.queryElementAt(i_enc, Ci.nsIWritablePropertyBag2);
@ -519,8 +515,9 @@ FeedWriter.prototype = {
if (enc.hasKey("length") && /^[0-9]+$/.test(enc.get("length"))) {
let enc_size = convertByteUnits(parseInt(enc.get("length")));
let size_text = this._getFormattedString("enclosureSizeText",
[enc_size[0], this._getString(enc_size[1])]);
size_text = this._getFormattedString("enclosureSizeText",
[enc_size[0],
this._getString(enc_size[1])]);
}
let iconimg = this._document.createElementNS(HTML_NS, "img");
@ -1061,7 +1058,6 @@ FeedWriter.prototype = {
let feedType = this._getFeedType();
// Subscribe to the feed using the selected handler and save prefs
let prefs = Services.prefs;
let defaultHandler = "reader";
let useAsDefault = this._document.getElementById("alwaysUse").getAttribute("checked");
@ -1084,7 +1080,7 @@ FeedWriter.prototype = {
this._window.location.href = handler.getHandlerURI(this._window.location.href);
}
} else {
let prefReader = null;
let feedReader = null;
switch (selectedItem.id) {
case "selectedAppMenuItem":
feedReader = "client";

Просмотреть файл

@ -1,7 +1,7 @@
function run_test() {
var success = false;
try {
var newURI = ios.newURI("feed:javascript:alert('hi');", null, null);
ios.newURI("feed:javascript:alert('hi');", null, null);
}
catch (e) {
success = e.result == Cr.NS_ERROR_MALFORMED_URI;
@ -11,7 +11,7 @@ function run_test() {
success = false;
try {
newURI = ios.newURI("feed:data:text/html,hi", null, null);
ios.newURI("feed:data:text/html,hi", null, null);
}
catch (e) {
success = e.result == Cr.NS_ERROR_MALFORMED_URI;
@ -21,7 +21,7 @@ function run_test() {
success = false;
try {
newURI = ios.newURI("pcast:javascript:alert('hi');", null, null);
ios.newURI("pcast:javascript:alert('hi');", null, null);
}
catch (e) {
success = e.result == Cr.NS_ERROR_MALFORMED_URI;
@ -31,7 +31,7 @@ function run_test() {
success = false;
try {
newURI = ios.newURI("pcast:data:text/html,hi", null, null);
ios.newURI("pcast:data:text/html,hi", null, null);
}
catch (e) {
success = e.result == Cr.NS_ERROR_MALFORMED_URI;

Просмотреть файл

@ -718,7 +718,7 @@ nsDefaultCommandLineHandler.prototype = {
if (!this._haveProfile) {
try {
// This will throw when a profile has not been selected.
var dir = Services.dirsvc.get("ProfD", Components.interfaces.nsILocalFile);
Services.dirsvc.get("ProfD", Components.interfaces.nsILocalFile);
this._haveProfile = true;
}
catch (e) {

Просмотреть файл

@ -1448,9 +1448,9 @@ BrowserGlue.prototype = {
}
];
let notification = notifyBox.appendNotification(text, "post-update-notification",
null, notifyBox.PRIORITY_INFO_LOW,
buttons);
notifyBox.appendNotification(text, "post-update-notification",
null, notifyBox.PRIORITY_INFO_LOW,
buttons);
}
if (actions.indexOf("showAlert") == -1)

Просмотреть файл

@ -633,12 +633,6 @@ var BookmarkPropertiesPanel = {
if (!PlacesUIUtils.useAsyncTransactions)
return this._createNewItem();
let txnFunc =
{ [BOOKMARK_FOLDER]: PlacesTransactions.NewFolder,
[LIVEMARK_CONTAINER]: PlacesTransactions.NewLivemark,
[BOOKMARK_ITEM]: PlacesTransactions.NewBookmark
}[this._itemType];
let [containerId, index] = this._getInsertionPointDetails();
let parentGuid = yield PlacesUtils.promiseItemGuid(containerId);
let annotations = [];

Просмотреть файл

@ -1402,7 +1402,6 @@ PlacesToolbar.prototype = {
* - folderElt: the folder to drop into, if applicable.
*/
_getDropPoint: function PT__getDropPoint(aEvent) {
let result = this.result;
if (!PlacesUtils.nodeIsFolder(this._resultNode))
return null;

Просмотреть файл

@ -389,7 +389,7 @@ PlacesController.prototype = {
return false;
// unwrapNodes() will throw if the data blob is malformed.
var unwrappedNodes = PlacesUtils.unwrapNodes(data, type.value);
PlacesUtils.unwrapNodes(data, type.value);
return this._view.insertionPoint != null;
}
catch (e) {
@ -1604,7 +1604,6 @@ var PlacesControllerDragHelper = {
data.ownerGlobal instanceof ChromeWindow) {
let uri = data.linkedBrowser.currentURI;
let spec = uri ? uri.spec : "about:blank";
let title = data.label;
unwrapped = { uri: spec,
title: data.label,
type: PlacesUtils.TYPE_X_MOZ_URL};
@ -1741,4 +1740,3 @@ function goDoPlacesCommand(aCommand)
if (controller && controller.isCommandEnabled(aCommand))
controller.doCommand(aCommand);
}

Просмотреть файл

@ -195,8 +195,7 @@ var gEditItemOverlay = {
if (this.initialized)
this.uninitPanel(false);
let { itemId, itemGuid, isItem,
isURI, uri, title,
let { itemId, isItem, isURI,
isBookmark, bulkTagging, uris,
visibleRows, focusedElement } = this._setPaneInfo(aInfo);
@ -626,7 +625,6 @@ var gEditItemOverlay = {
return;
if (!PlacesUIUtils.useAsyncTransactions) {
let itemId = this._paneInfo.itemId;
let txn = new PlacesEditBookmarkURITransaction(this._paneInfo.itemId, newURI);
PlacesUtils.transactionManager.doTransaction(txn);
return;

Просмотреть файл

@ -572,7 +572,6 @@ var PlacesOrganizer = {
* state in a bookmark->folder->bookmark scenario.
*/
var infoBox = document.getElementById("infoBox");
var infoBoxExpander = document.getElementById("infoBoxExpander");
var infoBoxExpanderWrapper = document.getElementById("infoBoxExpanderWrapper");
var additionalInfoBroadcaster = document.getElementById("additionalInfoBroadcaster");
@ -1370,7 +1369,7 @@ var ContentArea = {
// Use ContentTree options as default.
let viewOptions = ContentTree.viewOptions;
if (this._specialViews.has(this.currentPlace)) {
let { view, options } = this._specialViews.get(this.currentPlace);
let { options } = this._specialViews.get(this.currentPlace);
for (let option in options) {
viewOptions[option] = options[option];
}

Просмотреть файл

@ -280,8 +280,6 @@ PlacesTreeView.prototype = {
if (this._isPlainContainer(aContainer))
return cc;
const openLiteral = PlacesUIUtils.RDF.GetResource("http://home.netscape.com/NC-rdf#open");
const trueLiteral = PlacesUIUtils.RDF.GetLiteral("true");
let sortingMode = this._result.sortingMode;
let rowsInserted = 0;
@ -1060,7 +1058,6 @@ PlacesTreeView.prototype = {
let [desiredColumn, desiredIsDescending] =
this._sortTypeToColumnType(aSortingMode);
let colCount = columns.count;
let column = this._findColumnByType(desiredColumn);
if (column) {
let sortDir = desiredIsDescending ? "descending" : "ascending";
@ -1385,7 +1382,7 @@ PlacesTreeView.prototype = {
},
getParentIndex: function PTV_getParentIndex(aRow) {
let [parentNode, parentRow] = this._getParentByChildRow(aRow);
let [, parentRow] = this._getParentByChildRow(aRow);
return parentRow;
},

Просмотреть файл

@ -122,8 +122,6 @@ function validate(aNode) {
PlacesUtils.asContainer(folderNode);
folderNode.containerOpen = true;
is(folderNode.childCount, 2, "confirm child count match");
var bookmarkNode = folderNode.getChild(0);
var separatorNode = folderNode.getChild(1);
folderNode.containerOpen = false;
aNode.containerOpen = false;
}

Просмотреть файл

@ -17,7 +17,6 @@ add_task(function* () {
yield withSidebarTree("bookmarks", function* (tree) {
// Select the new bookmark in the sidebar.
let itemId = PlacesUIUtils.leftPaneQueries["UnfiledBookmarks"];
tree.selectItems([newBookmarkId]);
ok(tree.controller.isCommandEnabled("placesCmd_new:folder"),
"'placesCmd_new:folder' on current selected node is enabled");

Просмотреть файл

@ -138,11 +138,11 @@ add_task(function* test_query_on_toolbar() {
});
add_task(function* test_search_contents() {
let item = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
url: "http://example.com/",
title: "example page",
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
index: 0 });
yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
url: "http://example.com/",
title: "example page",
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
index: 0 });
let library = yield promiseLibrary();
info("Ensure query contents can be cut or deleted");
@ -175,11 +175,11 @@ add_task(function* test_search_contents() {
});
add_task(function* test_tags() {
let item = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
url: "http://example.com/",
title: "example page",
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
index: 0 });
yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
url: "http://example.com/",
title: "example page",
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
index: 0 });
PlacesUtils.tagging.tagURI(NetUtil.newURI("http://example.com/"), ["test"]);
let library = yield promiseLibrary();

Просмотреть файл

@ -187,8 +187,7 @@ var bookmarksObserver = {
onItemRemoved: function PSB_onItemRemoved(aItemId, aFolder, aIndex) {
var node = null;
var index = null;
[node, index] = getNodeForTreeItem(aItemId, gLibrary.PlacesOrganizer._places);
[node, ] = getNodeForTreeItem(aItemId, gLibrary.PlacesOrganizer._places);
is(node, null, "Places node not found in left pane");
},
@ -230,7 +229,7 @@ var bookmarksObserver = {
tree.columns.getColumnAt(0));
return cellText == aNewValue;
}
let [node, index, valid] = getNodeForTreeItem(aItemId, gLibrary.PlacesOrganizer._places, validator);
let [node, , valid] = getNodeForTreeItem(aItemId, gLibrary.PlacesOrganizer._places, validator);
if (node) // Only visible nodes.
ok(valid, "Title cell value has been correctly updated");
}

Просмотреть файл

@ -218,8 +218,7 @@ var bookmarksObserver = {
// Check that item has been removed.
for (var i = 0; i < views.length; i++) {
var node = null;
var index = null;
[node, index] = searchItemInView(aItemId, views[i]);
[node, ] = searchItemInView(aItemId, views[i]);
is(node, null, "Places node not found in " + views[i]);
}
},
@ -273,7 +272,7 @@ var bookmarksObserver = {
};
for (var i = 0; i < views.length; i++) {
var [node, index, valid] = searchItemInView(aItemId, views[i], validator);
var [node, , valid] = searchItemInView(aItemId, views[i], validator);
isnot(node, null, "Found changed Places node in " + views[i]);
is(node.title, aNewValue, "Node has correct title: " + aNewValue);
ok(valid, "Node element has correct label: " + aNewValue);

Просмотреть файл

@ -37,7 +37,7 @@ function countFolderChildren(aFolderItemId) {
add_task(function* setup() {
// Initialize browserGlue, but remove it's listener to places-init-complete.
let bg = Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIObserver);
Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIObserver);
// Initialize Places.
PlacesUtils.history;

Просмотреть файл

@ -471,8 +471,6 @@ var gCookiesWindow = {
},
_makeCookieObject: function (aStrippedHost, aCookie) {
var host = aCookie.host;
var formattedHost = host.charAt(0) == "." ? host.substring(1, host.length) : host;
var c = { name : aCookie.name,
value : aCookie.value,
isDomain : aCookie.isDomain,

Просмотреть файл

@ -43,7 +43,6 @@ var gContentPane = {
}
}
let doNotDisturbAlertsEnabled = false;
if (AlertsServiceDND) {
let notificationsDoNotDisturbRow =
document.getElementById("notificationsDoNotDisturbRow");

Просмотреть файл

@ -296,9 +296,9 @@ var gMainPane = {
setHomePageToBookmark: function ()
{
var rv = { urls: null, names: null };
var dialog = gSubDialog.open("chrome://browser/content/preferences/selectBookmark.xul",
"resizable=yes, modal=yes", rv,
this._setHomePageToBookmarkClosed.bind(this, rv));
gSubDialog.open("chrome://browser/content/preferences/selectBookmark.xul",
"resizable=yes, modal=yes", rv,
this._setHomePageToBookmarkClosed.bind(this, rv));
},
_setHomePageToBookmarkClosed: function(rv, aEvent) {

Просмотреть файл

@ -401,7 +401,6 @@ var gPermissionManager = {
this._permissions = [];
// load permissions into a table
var count = 0;
var enumerator = Services.perms.enumerator;
while (enumerator.hasMoreElements()) {
var nextPermission = enumerator.getNext().QueryInterface(Components.interfaces.nsIPermission);

Просмотреть файл

@ -821,8 +821,6 @@
case "cmd_clearhistory":
var param = this._self.getAttribute("autocompletesearchparam");
let searchBar = this._self.parentNode;
BrowserSearch.searchBar.FormHistory.update({ op : "remove", fieldname : param }, null);
this._self.value = "";
break;
@ -1682,9 +1680,6 @@
<parameter name="aWrapAround"/>
<parameter name="aCycleEngines"/>
<body><![CDATA[
let popup = this.popup;
let list = document.getAnonymousElementByAttribute(popup, "anonid",
"search-panel-one-offs");
let selectedButton = this.selectedButton;
let buttons = this.getSelectableButtons(aCycleEngines);

Просмотреть файл

@ -163,7 +163,7 @@ add_task(function* testShiftAltReturn() {
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, url);
EventUtils.synthesizeKey("VK_RETURN", { shiftKey: true, altKey: true });
let newTab = yield newTabPromise;
yield newTabPromise;
is(gBrowser.tabs.length, preTabNo + 1, "Shift+Alt+Return key added new tab");
is(gBrowser.currentURI.spec, url, "testShiftAltReturn opened correct search page");

Просмотреть файл

@ -11,6 +11,8 @@ function test() {
// Bug 992270: Ignore uncaught about:home exceptions (related to snippets from IndexedDB)
ignoreAllUncaughtExceptions(true);
let previouslySelectedEngine = Services.search.currentEngine;
function replaceUrl(base) {
return base;
}
@ -21,7 +23,6 @@ function test() {
let engine = Services.search.getEngineByName(engine_name);
ok(engine, engine_name + " is installed");
let previouslySelectedEngine = Services.search.currentEngine;
Services.search.currentEngine = engine;
// load about:home, but remove the listener first so it doesn't
@ -128,6 +129,7 @@ function test() {
}
registerCleanupFunction(function () {
Services.search.currentEngine = previouslySelectedEngine;
gBrowser.removeProgressListener(listener);
gBrowser.removeTab(tab);
if (gMutationObserver)

Просмотреть файл

@ -7,8 +7,6 @@ add_task(function* () {
Services.prefs.setIntPref("browser.startup.page", 0);
registerCleanupFunction(() => Services.prefs.clearUserPref("browser.startup.page"));
let engineURL =
"http://mochi.test:8888/browser/browser/components/search/test/";
let windowsToClose = [];
function performSearch(aWin, aIsPrivate) {

Просмотреть файл

@ -371,7 +371,7 @@ add_task(function* test_tab_and_arrows() {
add_task(function* test_open_search() {
let rootDir = getRootDirectory(gTestPath);
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, rootDir + "opensearch.html");
yield BrowserTestUtils.openNewForegroundTab(gBrowser, rootDir + "opensearch.html");
let promise = promiseEvent(searchPopup, "popupshown");
info("Opening search panel");

Просмотреть файл

@ -132,7 +132,6 @@ add_task(function* open_empty() {
textbox.value = "foo";
promise = promiseEvent(searchPopup, "popuphidden");
let clickPromise = promiseEvent(searchIcon, "click");
info("Hiding popup");
yield synthesizeNativeMouseClick(searchIcon);

Просмотреть файл

@ -299,7 +299,7 @@ add_task(function* test_tab_and_arrows() {
add_task(function* test_open_search() {
let rootDir = getRootDirectory(gTestPath);
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, rootDir + "opensearch.html");
yield BrowserTestUtils.openNewForegroundTab(gBrowser, rootDir + "opensearch.html");
let promise = promiseEvent(searchPopup, "popupshown");
info("Opening search panel");

Просмотреть файл

@ -70,15 +70,12 @@ function onPageLoad() {
}
function test() {
var osString = Cc["@mozilla.org/xre/app-info;1"].
getService(Ci.nsIXULRuntime).OS;
try {
// If GSettings is available, then the GConf tests
// will fail
var gsettings = Cc["@mozilla.org/gsettings-service;1"].
getService(Ci.nsIGSettingsService).
getCollectionForSchema("org.gnome.desktop.background");
Cc["@mozilla.org/gsettings-service;1"].
getService(Ci.nsIGSettingsService).
getCollectionForSchema("org.gnome.desktop.background");
todo(false, "This test doesn't work when GSettings is available");
return;
} catch (e) { }

Просмотреть файл

@ -70,9 +70,9 @@ function run_test() {
try {
// If GSettings is available, then the GConf tests
// will fail
var gsettings = Cc["@mozilla.org/gsettings-service;1"].
getService(Ci.nsIGSettingsService).
getCollectionForSchema("org.gnome.desktop.background");
Cc["@mozilla.org/gsettings-service;1"].
getService(Ci.nsIGSettingsService).
getCollectionForSchema("org.gnome.desktop.background");
return;
} catch (e) { }

Просмотреть файл

@ -126,7 +126,6 @@ Object.assign(SyncedTabsListStore.prototype, EventEmitter.prototype, {
moveSelectionUp() {
let branchRow = this._selectedRow[0];
let childRow = this._selectedRow[1];
let branch = this.data[branchRow];
if (this.filter) {
this.selectRow(branchRow - 1);
@ -234,4 +233,3 @@ Object.assign(SyncedTabsListStore.prototype, EventEmitter.prototype, {
.catch(Cu.reportError);
}
});

Просмотреть файл

@ -185,7 +185,6 @@ add_task(function* testPanelStatus() {
});
add_task(function* testActions() {
let listComponent = {};
let windowMock = {
openUILink() {},
};

Просмотреть файл

@ -419,7 +419,7 @@ var BingTokenManager = {
};
this._pendingRequest = deferred.promise;
let request = httpRequest(url, options);
httpRequest(url, options);
return deferred.promise;
}

Просмотреть файл

@ -503,7 +503,6 @@ function swapTextForItem(item, target) {
// visitStack is the stack of items that we still need to visit.
// Let's start the process by adding the root item.
let visitStack = [ item ];
let source = target == "translation" ? "original" : "translation";
while (visitStack.length > 0) {
let curItem = visitStack.shift();

Просмотреть файл

@ -194,7 +194,6 @@ function run_tests(aFinishCallback) {
info("Reopen to check the 'Not Now' button closes the notification.");
notif = showTranslationUI("fr");
let notificationBox = gBrowser.getNotificationBox();
is(hasTranslationInfoBar(), true, "there's a 'translate' notification");
notif._getAnonElt("notNow").click();
is(hasTranslationInfoBar(), false, "no 'translate' notification after clicking 'not now'");

Просмотреть файл

@ -218,7 +218,8 @@ add_task(function* test_show_original() {
});
add_task(function* test_language_change() {
for (let i of Array(4)) {
// This is run 4 times, the total additions are checked afterwards.
for (let i of Array(4)) { // eslint-disable-line no-unused-vars
let tab = yield offerTranslationFor("<h1>Hallo Welt!</h1>", "fr");
let browser = tab.linkedBrowser;
// In the offer state, translation is executed by the Translate button,

Просмотреть файл

@ -180,7 +180,6 @@ this.UITour = {
["searchPrefsLink", {
query: (aDocument) => {
let element = null;
let searchbar = aDocument.getElementById("searchbar");
let popup = aDocument.getElementById("PopupSearchAutoComplete");
if (popup.state != "open")
return null;
@ -1832,7 +1831,7 @@ this.UITour = {
} else if (AppConstants.platform == "linux") {
// The ShellService may not exist on some versions of Linux.
try {
let shell = aWindow.getShellService();
aWindow.getShellService();
} catch (e) {
canSetDefaultBrowserInBackground = null;
}

Просмотреть файл

@ -119,7 +119,6 @@ add_UITour_task(function* test_info_buttons_2() {
}),
add_UITour_task(function* test_info_close_button() {
let popup = document.getElementById("UITourTooltip");
let closeButton = document.getElementById("UITourTooltipClose");
yield showInfoPromise("urlbar", "Close me", "X marks the spot", null, null, "makeInfoOptions");

1
browser/extensions/flyweb/bootstrap.js поставляемый
Просмотреть файл

@ -237,7 +237,6 @@ let FlyWebView = {
onViewShowing(aEvent) {
let doc = aEvent.target.ownerDocument;
let panel = doc.getElementById("flyweb-panel");
let items = doc.getElementById("flyweb-items");
let empty = doc.getElementById("flyweb-items-empty");

Просмотреть файл

@ -195,7 +195,6 @@ FormSubmitObserver.prototype =
// We want to show the popup at the middle of checkbox and radio buttons
// and where the content begin for the other elements.
let offset = 0;
let position = "";
if (aElement.tagName == 'INPUT' &&
(aElement.type == 'radio' || aElement.type == 'checkbox')) {

Просмотреть файл

@ -135,7 +135,6 @@ PluginContent.prototype = {
if (this.haveShownNotification &&
aSubject.top.document == this.content.document &&
data.formats.toLowerCase().includes("application/x-mpegurl", 0)) {
let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
let principal = this.content.document.nodePrincipal;
let location = this.content.document.location.href;
this.global.content.pluginRequiresReload = true;
@ -453,7 +452,6 @@ PluginContent.prototype = {
}
let plugin = event.target;
let doc = plugin.ownerDocument;
if (eventType == "PluginPlaceholderReplaced") {
plugin.removeAttribute("href");
@ -514,7 +512,6 @@ PluginContent.prototype = {
case "PluginVulnerableNoUpdate":
case "PluginClickToPlay":
this._handleClickToPlayEvent(plugin);
let overlay = this.getPluginUI(plugin, "main");
let pluginName = this._getPluginInfo(plugin).pluginName;
let messageString = gNavigatorBundle.formatStringFromName("PluginClickToActivate", [pluginName], 1);
let overlayText = this.getPluginUI(plugin, "clickToPlay");

Просмотреть файл

@ -213,7 +213,7 @@ var ProcessHangMonitor = {
*/
findPausedReport: function(browser) {
let frameLoader = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
for (let [report, timer] of this._pausedReports) {
for (let [report, ] of this._pausedReports) {
if (report.isReportForBrowser(frameLoader)) {
return report;
}
@ -288,7 +288,6 @@ var ProcessHangMonitor = {
}
let bundle = win.gNavigatorBundle;
let brandBundle = win.document.getElementById("bundle_brand");
let buttons = [{
label: bundle.getString("processHang.button_stop.label"),

Просмотреть файл

@ -37,7 +37,6 @@ var RemotePrompt = {
openTabPrompt: function(args, browser) {
let window = browser.ownerGlobal;
let tabPrompt = window.gBrowser.getTabModalPromptBox(browser)
let callbackInvoked = false;
let newPrompt;
let needRemove = false;
let promptId = args._remoteId;

Просмотреть файл

@ -33,7 +33,7 @@ var Windows8WindowFrameColor = {
// Zero-pad the number just to make sure that it is 8 digits.
customizationColorHex = ("00000000" + customizationColorHex).substr(-8);
let customizationColorArray = customizationColorHex.match(/../g);
let [unused, fgR, fgG, fgB] = customizationColorArray.map(val => parseInt(val, 16));
let [, fgR, fgG, fgB] = customizationColorArray.map(val => parseInt(val, 16));
let colorizationColorBalance = Registry.readRegKey(HKCU, dwmKey,
"ColorizationColorBalance");
if (colorizationColorBalance == undefined) {

Просмотреть файл

@ -471,7 +471,7 @@ TabWindow.prototype = {
// Because making a tab visible requires that the tab it is next to be
// visible, it is far simpler to unset the 'next' tab and recreate them all
// at once.
for (let [tab, preview] of this.previews) {
for (let [, preview] of this.previews) {
preview.move(null);
preview.visible = enable;
}
@ -835,7 +835,7 @@ this.AeroPeek = {
onPageChanged(uri, changedConst, newValue) {
if (this.enabled && changedConst == Ci.nsINavHistoryObserver.ATTRIBUTE_FAVICON) {
for (let win of this.windows) {
for (let [tab, preview] of win.previews) {
for (let [tab, ] of win.previews) {
if (tab.getAttribute("image") == newValue) {
win.onLinkIconAvailable(tab.linkedBrowser, newValue);
}

Просмотреть файл

@ -114,7 +114,6 @@ add_task(function* searchInBackgroundTab() {
// search page should be loaded in the same tab that performed the search, in
// the background tab.
yield addTab();
let searchBrowser = gBrowser.selectedBrowser;
let engine = Services.search.currentEngine;
let data = {
engineName: engine.name,

Просмотреть файл

@ -506,8 +506,7 @@ add_task(function* test_shutdown_while_not_showing() {
UnsubmittedCrashHandler.uninit();
Assert.throws(() => {
let shutdownWhileShowing =
UnsubmittedCrashHandler.prefs.getBoolPref("shutdownWhileShowing");
UnsubmittedCrashHandler.prefs.getBoolPref("shutdownWhileShowing");
}, "We should have noticed that the notification had closed before " +
"uninitting.");
UnsubmittedCrashHandler.init();

Просмотреть файл

@ -68,7 +68,6 @@ add_task(function* test_sessionRestore() {
// Save the current session.
let SessionStore =
Cu.import("resource:///modules/sessionstore/SessionStore.jsm", {}).SessionStore;
let backupState = SessionStore.getBrowserState();
// Load the custom state and wait for SSTabRestored, as we want to make sure
// that the URI counting code was hit.

Просмотреть файл

@ -97,8 +97,4 @@ function test() {
function checkSelectedTab() {
return getPreviewForTab(gBrowser.selectedTab).active;
}
function isTabSelected(idx) {
return gBrowser.tabs[idx].selected;
}
}

Просмотреть файл

@ -480,7 +480,7 @@ add_task(function* test_topSitesWithSuggestedLinks() {
let dataURI = 'data:application/json,' + JSON.stringify(data);
yield promiseSetupDirectoryLinksProvider({linksURL: dataURI});
let links = yield fetchData();
yield fetchData();
// Check we've populated suggested links as expected.
do_check_eq(DirectoryLinksProvider._suggestedLinks.size, 5);
@ -1609,7 +1609,7 @@ add_task(function* test_sanitizeExplanation() {
let dataURI = 'data:application/json,' + encodeURIComponent(JSON.stringify(data));
yield promiseSetupDirectoryLinksProvider({linksURL: dataURI});
let links = yield fetchData();
yield fetchData();
let suggestedSites = [...DirectoryLinksProvider._suggestedLinks.keys()];
do_check_eq(suggestedSites.indexOf("eviltarget.com"), 0);
@ -1796,7 +1796,6 @@ add_task(function* test_inadjecentSites() {
add_task(function* test_blockSuggestedTiles() {
// Initial setup
let suggestedTile = suggestedTile1;
let topSites = ["site0.com", "1040.com", "site2.com", "hrblock.com", "site4.com", "freetaxusa.com", "site6.com"];
let data = {"suggested": [suggestedTile1, suggestedTile2, suggestedTile3], "directory": [someOtherSite]};
let dataURI = 'data:application/json,' + JSON.stringify(data);