Skip to content

Conversation

@alexpenev-s
Copy link
Owner

No description provided.

@dotchev
Copy link

dotchev commented Nov 23, 2016

Will this fix issue SAP#64?

self._state.receive = null; // a callback should be called only once
cb(err);
} else {
} else if (self.listenerCount('error')) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

listenerCount is present since v3.2.0, see https://nodejs.org/api/events.html#events_emitter_listenercount_eventname
package.json says "node": ">= 0.12"
we could do it like this
self.listenerCount && self.listenerCount('error') || self.listeners('error').length

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants