Skip to content

Commit

Permalink
Bug 1655400 - Enable ESLint rule no-setter-return for all of places. …
Browse files Browse the repository at this point in the history
…r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D85021
  • Loading branch information
soniasingla committed Jul 29, 2020
1 parent 42ec569 commit df381c2
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 42 deletions.
7 changes: 0 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -955,12 +955,6 @@ module.exports = {
"browser/components/downloads/content/indicator.js",
"browser/components/payments/res/components/csc-input.js",
"browser/components/payments/res/components/labelled-checkbox.js",
"browser/components/places/content/browserPlacesViews.js",
"browser/components/places/content/controller.js",
"browser/components/places/content/places-menupopup.js",
"browser/components/places/content/places-tree.js",
"browser/components/places/content/places.js",
"browser/components/places/content/treeView.js",
"browser/components/pocket/content/Pocket.jsm",
"browser/components/preferences/search.js",
"browser/components/search/content/search-one-offs.js",
Expand All @@ -984,7 +978,6 @@ module.exports = {
"toolkit/components/extensions/ExtensionParent.jsm",
"toolkit/components/osfile/modules/osfile_async_front.jsm",
"toolkit/components/osfile/modules/osfile_shared_allthreads.jsm",
"toolkit/components/places/PlacesExpiration.jsm",
"toolkit/content/aboutSupport.js",
"toolkit/content/customElements.js",
"toolkit/content/preferencesBindings.js",
Expand Down
7 changes: 1 addition & 6 deletions browser/components/places/content/browserPlacesViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ PlacesViewBase.prototype = {
history.queryStringToQuery(val, query, options);
let result = history.executeQuery(query.value, options.value);
result.addObserver(this);
return val;
},

_result: null,
Expand All @@ -72,7 +71,7 @@ PlacesViewBase.prototype = {
},
set result(val) {
if (this._result == val) {
return val;
return;
}

if (this._result) {
Expand All @@ -97,8 +96,6 @@ PlacesViewBase.prototype = {
this._resultNode = null;
delete this._domNodes;
}

return val;
},

_options: null,
Expand All @@ -114,8 +111,6 @@ PlacesViewBase.prototype = {
val.extraClasses = {};
}
this._options = val;

return val;
},

/**
Expand Down
3 changes: 1 addition & 2 deletions browser/components/places/content/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function PlacesInsertionPoint({

PlacesInsertionPoint.prototype = {
set index(val) {
return (this._index = val);
this._index = val;
},

async getIndex() {
Expand Down Expand Up @@ -1175,7 +1175,6 @@ PlacesController.prototype = {
updateCutNodes(false);
this._cutNodes = aNodes;
updateCutNodes(true);
return aNodes;
},

/**
Expand Down
10 changes: 5 additions & 5 deletions browser/components/places/content/places-menupopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,35 @@
return this._folder.elt;
},
set elt(val) {
return (this._folder.elt = val);
this._folder.elt = val;
},

get openTimer() {
return this._folder.openTimer;
},
set openTimer(val) {
return (this._folder.openTimer = val);
this._folder.openTimer = val;
},

get hoverTime() {
return this._folder.hoverTime;
},
set hoverTime(val) {
return (this._folder.hoverTime = val);
this._folder.hoverTime = val;
},

get closeTimer() {
return this._folder.closeTimer;
},
set closeTimer(val) {
return (this._folder.closeTimer = val);
this._folder.closeTimer = val;
},

get closeMenuTimer() {
return this._closeMenuTimer;
},
set closeMenuTimer(val) {
return (this._closeMenuTimer = val);
this._closeMenuTimer = val;
},

setTimer: function OF__setTimer(aTime) {
Expand Down
11 changes: 3 additions & 8 deletions browser/components/places/content/places-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@
} else {
this.removeAttribute("disableUserActions");
}
return val;
}

get disableUserActions() {
Expand All @@ -163,12 +162,11 @@
// We save the view so that we can avoid expensive get calls when
// we need to get the view again.
this._view = val;
/* eslint-disable no-undef */
return Object.getOwnPropertyDescriptor(
Object.getOwnPropertyDescriptor(
// eslint-disable-next-line no-undef
XULTreeElement.prototype,
"view"
).set.call(this, val);
/* eslint-enable no-undef */
}

get view() {
Expand All @@ -188,7 +186,6 @@
this.place = this.place;
}
}
return val;
}

get flatList() {
Expand All @@ -215,8 +212,6 @@
options = {};
PlacesUtils.history.queryStringToQuery(val, query, options);
this.load(query.value, options.value);

return val;
}

get place() {
Expand Down Expand Up @@ -409,7 +404,7 @@
}

set active(val) {
return (this._active = val);
this._active = val;
}

get active() {
Expand Down
13 changes: 3 additions & 10 deletions browser/components/places/content/places.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ var PlacesOrganizer = {

set location(aLocation) {
if (!aLocation || this._location == aLocation) {
return aLocation;
return;
}

if (this.location) {
Expand Down Expand Up @@ -313,8 +313,6 @@ var PlacesOrganizer = {
.getElementById("OrganizerCommand:Forward")
.removeAttribute("disabled");
}

return aLocation;
},

_backHistory: [],
Expand Down Expand Up @@ -838,7 +836,6 @@ var PlacesSearchBox = {
},
set folders(aFolders) {
this._folders = aFolders;
return aFolders;
},

/**
Expand Down Expand Up @@ -947,13 +944,11 @@ var PlacesSearchBox = {
},
set filterCollection(collectionName) {
if (collectionName == this.filterCollection) {
return collectionName;
return;
}

this.searchFilter.setAttribute("collection", collectionName);
this.updateCollectionTitle();

return collectionName;
},

/**
Expand All @@ -977,7 +972,7 @@ var PlacesSearchBox = {
return this.searchFilter.value;
},
set value(value) {
return (this.searchFilter.value = value);
this.searchFilter.value = value;
},
};

Expand Down Expand Up @@ -1380,7 +1375,6 @@ var ContentArea = {
aNewView.associatedElement.focus();
}
}
return aNewView;
},

get currentPlace() {
Expand All @@ -1396,7 +1390,6 @@ var ContentArea = {
this._setupView();
newView.active = true;
}
return aQueryString;
},

/**
Expand Down
2 changes: 0 additions & 2 deletions browser/components/places/content/treeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1210,8 +1210,6 @@ PlacesTreeView.prototype = {
if (this._tree && val) {
this._finishInit();
}

return val;
},

/**
Expand Down
2 changes: 0 additions & 2 deletions toolkit/components/places/PlacesExpiration.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,6 @@ nsPlacesExpiration.prototype = {
// idle only if history is dirty, to preserve mobile devices batteries.
this.expireOnIdle = aNewStatus == STATUS.DIRTY;
}
return aNewStatus;
},
get status() {
return this._status;
Expand All @@ -786,7 +785,6 @@ nsPlacesExpiration.prototype = {
} else {
this._expireOnIdle = aExpireOnIdle;
}
return this._expireOnIdle;
},
get expireOnIdle() {
return this._expireOnIdle;
Expand Down

0 comments on commit df381c2

Please sign in to comment.