// deno-fmt-ignore-file // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. // Taken from Node 18.12.1 // This file is automatically generated by "node/_tools/setup.ts". Do not modify this file manually 'use strict'; require('../common'); const assert = require('assert'); const EventEmitter = require('events'); const emitter = new EventEmitter(); emitter.on('foo', () => {}); emitter.on('foo', () => {}); emitter.on('baz', () => {}); // Allow any type emitter.on(123, () => {}); assert.strictEqual(EventEmitter.listenerCount(emitter, 'foo'), 2); assert.strictEqual(emitter.listenerCount('foo'), 2); assert.strictEqual(emitter.listenerCount('bar'), 0); assert.strictEqual(emitter.listenerCount('baz'), 1); assert.strictEqual(emitter.listenerCount(123), 1);