Skip to content

Commit a424fec

Browse files
pierremoreauepriestley
authored and
epriestley
committedFeb 3, 2015
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
1 parent 9df4cb3 commit a424fec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎support/aphlict/server/lib/AphlictListenerList.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ JX.install('AphlictListenerList', {
4242
},
4343

4444
getActiveListenerCount: function() {
45-
return this._listeners.length;
45+
return Object.keys(this._listeners).length;
4646
},
4747

4848
getTotalListenerCount: function() {

0 commit comments

Comments
 (0)
Failed to load comments.