Skip to content

Commit ea7b3d9

Browse files
authored
Merge pull request #1 from charphq/fix/match-count-logic
Change argument order for add/remove match exist check
2 parents 6b8f447 + e875f30 commit ea7b3d9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/bus.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ class MessageBus extends EventEmitter {
483483
}
484484

485485
_addMatch (match) {
486-
if (Object.prototype.hasOwnProperty.call(match, this._matchRules)) {
486+
if (Object.prototype.hasOwnProperty.call(this._matchRules, match)) {
487487
this._matchRules[match] += 1;
488488
return Promise.resolve();
489489
}
@@ -507,7 +507,7 @@ class MessageBus extends EventEmitter {
507507
return Promise.resolve();
508508
}
509509

510-
if (Object.prototype.hasOwnProperty.call(match, this._matchRules)) {
510+
if (Object.prototype.hasOwnProperty.call(this._matchRules, match)) {
511511
this._matchRules[match] -= 1;
512512
if (this._matchRules[match] > 0) {
513513
return Promise.resolve();

0 commit comments

Comments
 (0)