Skip to content

events.getMaxListeners() always returns default value when passed a NodeEventTarget #67916

Backlog

Description

@outslept

Version

v26.13.0

Platform

Microsoft Windows NT 10.0.19045.0 x64

Subsystem

events

What steps will reproduce the bug?

import { getMaxListeners, setMaxListeners } from 'node:events';

const { port1 } = new MessageChannel();
setMaxListeners(2, port1);
console.log(getMaxListeners(port1));

How often does it reproduce? Is there a required condition?

always, no condition

What is the expected behavior? Why is that the expected behavior?

it should print 2

What do you see instead?

it prints 10 (default number of listeners)

Additional information

No response

Activity

  1. changed the title [-]events: getMaxListeners ignores setMaxListeners[/-] [+]`events.getMaxListeners()` always returns default value when passed a NodeEventTarget[/+] on Nov 30, 2026
  2. added
    events
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    events

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions