mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-26 12:22:50 +01:00
Minor fixes to code (#3720)
* Fix leftovers from old code. * change changes.procedural.size to changes.procedural.length changes.procedural is an array so it should be changes.procedural.length the code works with changes.procedural.size because (undefined !== 0) is always true.
This commit is contained in:
parent
fa3b76eb22
commit
4d3a2b5f85
@ -296,7 +296,7 @@ vAPI.messaging = {
|
||||
// the main process is no longer reachable: memory leaks and bad
|
||||
// performance become a risk -- especially for long-lived, dynamic
|
||||
// pages. Guard against this.
|
||||
if ( this.pendingCount > 25 ) {
|
||||
if ( this.pending.size > 25 ) {
|
||||
vAPI.shutdown.exec();
|
||||
}
|
||||
this.connect();
|
||||
@ -340,7 +340,7 @@ vAPI.messaging = {
|
||||
removeChannelListener: function(channelName, listener) {
|
||||
var listeners = this.channels.get(channelName);
|
||||
if ( listeners === undefined ) { return; }
|
||||
var pos = this.listeners.indexOf(listener);
|
||||
var pos = listeners.indexOf(listener);
|
||||
if ( pos === -1 ) { return; }
|
||||
listeners.splice(pos, 1);
|
||||
if ( listeners.length === 0 ) {
|
||||
|
@ -197,7 +197,7 @@ var handlers = {
|
||||
for ( selector of changes.procedural ) {
|
||||
procedural.dict.set(selector.raw, selector);
|
||||
}
|
||||
if ( changes.procedural.size !== 0 ) {
|
||||
if ( changes.procedural.length !== 0 ) {
|
||||
jobQueue.push(ProceduralJob.create());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user