Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

push(x) after push(null) should cause an error #45

Open
martinheidegger opened this issue May 19, 2021 · 1 comment
Open

push(x) after push(null) should cause an error #45

martinheidegger opened this issue May 19, 2021 · 1 comment

Comments

@martinheidegger
Copy link
Contributor

Similarly to #44, the following test currently fails:

tape('push after push(null) should cause an error', function (t) {
  t.plan(5)
  const s = new Readable()
  s.on('data', function (data) {
    t.equals(data, 'a')
  })
  s.on('error', function () {
    t.pass('stream.push() after EOF')
  })
  s.on('close', function () {
    t.end()
  })
  t.equals(s.push('a'), true)
  t.equals(s.push(null), false)
  t.equals(s.push('b'), false)
})

Both pushed data statements are passed through and no error like stream.push() after EOF as this is an incompatibility to the current Node.js streams and am wondering: is that intentional? should that be documented?

@mafintosh
Copy link
Owner

Yea basically just reflection the simplicity point here, https://github.com/streamxorg/streamx#simplicity
If trivial to add, feel free to PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants