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
F14007792: D9554.diff
Tue, Oct 29, 11:42 AM
F14002804: D9554.id.diff
Fri, Oct 25, 10:44 PM
F14002742: D9554.id22903.diff
Fri, Oct 25, 9:51 PM
F14002741: D9554.id22908.diff
Fri, Oct 25, 9:51 PM
F14000159: D9554.diff
Thu, Oct 24, 7:39 PM
F13991794: D9554.diff
Tue, Oct 22, 12:51 PM
F13964846: D9554.id22903.diff
Tue, Oct 15, 10:16 PM
Unknown Object (File)
Sep 1 2024, 6:28 AM
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).