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
F18762538: D9554.id22908.diff
Mon, Oct 6, 7:30 PM
F18762537: D9554.id22903.diff
Mon, Oct 6, 7:30 PM
F18762536: D9554.id.diff
Mon, Oct 6, 7:30 PM
F18762520: D9554.diff
Mon, Oct 6, 7:26 PM
F18700941: D9554.diff
Sat, Sep 27, 4:19 PM
F18466016: D9554.diff
Sep 2 2025, 8:33 AM
F18380373: D9554.id.diff
Aug 28 2025, 5:38 PM
F18363056: D9554.diff
Aug 27 2025, 3:35 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).