Skip to content

Streams: readable stream does not get _construct called #36058

Description

@a0viedo
  • Version: v14.15.0
  • Platform: Linux
  • Subsystem: streams

What steps will reproduce the bug?

const { Readable } = require('stream');
class ReadStream extends Readable {
  constructor() {
    super();
  }
  _construct(cb) {
      console.log('_construct called');
      cb();
  }
  _read(n) {
  }
}

(new ReadStream()).on('data', ()=>{});

If I run the above with v14.15.0 nothing gets printed but on v15.0.1 I get "_construct called".

How often does it reproduce?

Always

What is the expected behavior?

_construct should be called

What do you see instead?

_construct is not called

Additional information

According to the docs this was added on v14.13.1
image

Activity

  1. lpinca commented on Nov 10, 2020

    @lpinca
    Member

    The feature is not available on Node.js 14.x. I think the Added in: 14.13.1 info is incorrect.

  2. reopened this on Nov 14, 2020
  3. targos commented on Nov 14, 2020

    @targos
    Member
  4. lpinca commented on Nov 14, 2020

    @lpinca
    Member
  5. targos commented on Nov 14, 2020

    @targos
    Member

    That PR just changes the version number. I think we should entirely remove that feature from the documentation in v14

  6. lpinca commented on Nov 14, 2020

    @lpinca
    Member

    Ah yes you are right, it makes sense.

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

    streamIssues and PRs related to Node.js streams.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions