mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-27 22:02:28 +01:00
Get rid of more deprecated Set method calls.
This commit is contained in:
@@ -677,8 +677,8 @@ var Option = Class("Option", {
|
||||
values = Array.concat(values);
|
||||
|
||||
function uniq(ary) {
|
||||
let seen = {};
|
||||
return ary.filter(elem => !Set.add(seen, elem));
|
||||
let seen = RealSet();
|
||||
return ary.filter(elem => !seen.add(elem));
|
||||
}
|
||||
|
||||
switch (operator) {
|
||||
|
||||
@@ -1698,7 +1698,8 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
* @returns {[string]} The visible domains.
|
||||
*/
|
||||
visibleHosts: function visibleHosts(win) {
|
||||
let res = [], seen = {};
|
||||
let res = [],
|
||||
seen = RealSet();
|
||||
(function rec(frame) {
|
||||
try {
|
||||
if (frame.location.hostname)
|
||||
@@ -1707,7 +1708,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
catch (e) {}
|
||||
Array.forEach(frame.frames, rec);
|
||||
})(win);
|
||||
return res.filter(h => !Set.add(seen, h));
|
||||
return res.filter(h => !seen.add(h));
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1718,7 +1719,8 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
* @returns {[nsIURI]} The visible URIs.
|
||||
*/
|
||||
visibleURIs: function visibleURIs(win) {
|
||||
let res = [], seen = {};
|
||||
let res = [],
|
||||
seen = RealSet();
|
||||
(function rec(frame) {
|
||||
try {
|
||||
res = res.concat(util.newURI(frame.location.href));
|
||||
@@ -1726,7 +1728,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
catch (e) {}
|
||||
Array.forEach(frame.frames, rec);
|
||||
})(win);
|
||||
return res.filter(h => !Set.add(seen, h.spec));
|
||||
return res.filter(h => !seen.add(h.spec));
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user