1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00

Aphlict - fix getActiveListenerCount return value

Summary: Ref T7126. Dictionaries do not have a `length` property unlike arrays resulting in the `getActiveListenerCount()` function returning undefined results. Using the `length` property on the array of keys will work.

Test Plan: Using `wscat` to generate multiple connections to the server, establish new ones and close others while keeping an eye on the displayed `clients.active` value.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7126

Differential Revision: https://secure.phabricator.com/D11647
This commit is contained in:
Pierre Moreau 2015-02-03 07:00:54 -08:00 committed by epriestley
parent 9df4cb37d4
commit a424fec7bb

View file

@ -42,7 +42,7 @@ JX.install('AphlictListenerList', {
},
getActiveListenerCount: function() {
return this._listeners.length;
return Object.keys(this._listeners).length;
},
getTotalListenerCount: function() {