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

two functions named destroy #15

Closed
evbogue opened this issue Nov 15, 2018 · 0 comments · Fixed by #16
Closed

two functions named destroy #15

evbogue opened this issue Nov 15, 2018 · 0 comments · Fixed by #16

Comments

@evbogue
Copy link

evbogue commented Nov 15, 2018

I was trying to use nexe to build an executable scuttlebot app, and it threw an error saying that this module has two functions with the same name.

This first destroy function:

function destroy(stream, cb) {
  function onClose () {
    cleanup(); cb()
  }
  function onError (err) {
    cleanup(); cb(err)
  }
  function cleanup() {
    stream.removeListener('close', onClose)
    stream.removeListener('error', onError)
  }
  stream.on('close', onClose)
  stream.on('error', onError)
}

The second destroy function:

function destroy (stream) {
  if(!stream.destroy)
    console.error(
      'warning, stream-to-pull-stream: \n'
    + 'the wrapped node-stream does not implement `destroy`, \n'
    + 'this may cause resource leaks.'
    )
  else stream.destroy()
}
alanshaw added a commit that referenced this issue Mar 20, 2019
This started causing problems when babel released this change yesterday babel/babel#9493

resolves #15
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

Successfully merging a pull request may close this issue.

1 participant