Page MenuHomePhabricator

Don't explicitly keep track of `_activeListenerCount` in the Aphlict server.
ClosedPublic

Authored by joshuaspence on Jun 15 2014, 7:08 PM.
Tags
None
Referenced Files
F15483229: D9554.id22903.diff
Wed, Apr 9, 10:54 AM
F15480939: D9554.id.diff
Tue, Apr 8, 5:28 PM
F15477521: D9554.diff
Mon, Apr 7, 3:41 PM
F15421043: D9554.id22908.diff
Fri, Mar 21, 8:33 PM
F15418538: D9554.diff
Thu, Mar 20, 11:54 PM
F15393134: D9554.id.diff
Sat, Mar 15, 7:53 PM
F15384883: D9554.id.diff
Fri, Mar 14, 9:05 PM
Unknown Object (File)
Mar 1 2025, 2:39 PM
Subscribers

Details

Summary

The _activeListenerCount variable is overkill, we should be able to achieve the same result using Object.keys(this._listeners).length.

Test Plan

Mucked around in a NodeJS shell.

> Object.keys({}).length
0
> Object.keys({foo: 'bar'}).length
1
> Object.keys({1: 'foo', 2: 'bar'}).length
2

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

joshuaspence retitled this revision from to Don't explicitly keep track of `_activeListenerCount` in the Aphlict server..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Jun 15 2014, 7:13 PM
joshuaspence updated this revision to Diff 22908.

Closed by commit rP279a0e53717e (authored by @joshuaspence).