Bug 1544834 - Replace non-test uses of deprecated Array generics r=evilpie,dao

- `Array.forEach` becomes for-of loop or `array.forEach`.
- `Array.slice(a)` or `Array.slice(a, 0)` becomes `Array.from(a)`.
- `Array.map` becomes `Array.from`
- `Array` copy + concatenation becomes Array literal + spread syntax.
- All other `Array.X(a, ...)` become `Array.prototype.X.call` or `Array.from(a).X(...)`

Differential Revision: https://phabricator.services.mozilla.com/D27802
This commit is contained in:
Rob Wu
2019-04-17 19:03:17 +00:00
parent 06adec8aee
commit 731bc4cb2e
27 changed files with 51 additions and 47 deletions

View File

@@ -289,7 +289,8 @@ var ctrlTab = {
},
advanceFocus: function ctrlTab_advanceFocus(aForward) {
let selectedIndex = Array.indexOf(this.previews, this.selected);
let selectedIndex = Array.prototype.indexOf.call(this.previews,
this.selected);
do {
selectedIndex += aForward ? 1 : -1;
if (selectedIndex < 0)
@@ -565,7 +566,7 @@ var ctrlTab = {
_initRecentlyUsedTabs() {
this._recentlyUsedTabs =
Array.filter(gBrowser.tabs, tab => !tab.closing)
Array.prototype.filter.call(gBrowser.tabs, tab => !tab.closing)
.sort((tab1, tab2) => tab2.lastAccessed - tab1.lastAccessed);
},