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
F19826749: D9554.diff
Mon, Mar 9, 12:54 AM
F19825400: D9554.id22903.diff
Sun, Mar 8, 11:05 AM
F19810919: D9554.id22903.diff
Tue, Mar 3, 9:50 PM
F19810748: D9554.diff
Tue, Mar 3, 9:04 PM
F19628830: D9554.id.diff
Feb 4 2026, 10:38 PM
F19628828: D9554.id.diff
Feb 4 2026, 10:38 PM
F19533663: D9554.id.diff
Jan 20 2026, 7:27 PM
F19105910: D9554.diff
Dec 6 2025, 3:46 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).