Skip to content

Listeners incorrectly removed #23

@lpinca

Description

@lpinca

Ultron removes listeners not added with Ultron when the listener is the same.

const EventEmitter = require('events');
const assert = require('assert');
const Ultron = require('.');

function listener() {}

const ee = new EventEmitter();
const ultron = new Ultron(ee);

ee.on('foo', listener);
ultron.on('foo', listener);

ultron.remove('foo');

assert.strictEqual(ee.listenerCount('foo'), 1);

The issue has been indirectly reported by @apapirovski in nodejs/node#17440 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions