Bug 1933092 - Move equalsObject helper into channels.js in cZ. r=frg
This commit is contained in:
Родитель
51d9e5c1e8
Коммит
7637a2ebbd
|
@ -288,22 +288,6 @@ function formatException(ex)
|
|||
return String(ex);
|
||||
}
|
||||
|
||||
function equalsObject(o1, o2)
|
||||
{
|
||||
for (var p in o1)
|
||||
{
|
||||
if (!(p in o2) || (o1[p] != o2[p]))
|
||||
return false;
|
||||
}
|
||||
for (p in o2)
|
||||
{
|
||||
// If the property did exist in o1, the previous loop tested it:
|
||||
if (!(p in o1))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function utils_lcfn(text)
|
||||
{
|
||||
return text.toLowerCase();
|
||||
|
|
|
@ -632,6 +632,22 @@ function processOpLoadStop(opData)
|
|||
|
||||
function processOpFilterStart(opData)
|
||||
{
|
||||
function equalsObject(o1, o2)
|
||||
{
|
||||
for (let p in o1)
|
||||
{
|
||||
if (!(p in o2) || (o1[p] != o2[p]))
|
||||
return false;
|
||||
}
|
||||
for (let p in o2)
|
||||
{
|
||||
// If the property did exist in o1, the previous loop tested it:
|
||||
if (!(p in o1))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
// Catch filtering with the same options on the same channels:
|
||||
var newOptions = {network: xul.network.value.toLowerCase(),
|
||||
text: xul.channel.value.toLowerCase(),
|
||||
|
|
Загрузка…
Ссылка в новой задаче