Skip to content

events: on() leaves emitter paused after return() #67917

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 { on } from 'node:events';
import { PassThrough } from 'node:stream';

const stream = new PassThrough();
const it = on(stream, 'data', { highWaterMark: 1 });

stream.write('a');
stream.write('b');

await it.return();

console.log(stream.isPaused());

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

always

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

prints false. сalling return stops listening to stream and should resume it if on paused it

What do you see instead?

prints true

Additional information

No response

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions