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

fs.write() and tls.connect() overloading should be separate methods instead #7039

Closed
slikts opened this issue May 28, 2016 · 1 comment
Closed
Labels
feature request Issues that request new features to be added to Node.js. invalid Issues and PRs that are invalid.

Comments

@slikts
Copy link

slikts commented May 28, 2016

fs.write() and tls.connect() have two different, incompatible signatures:

fs.write(fd, buffer, offset, length[, position], callback)
fs.write(fd, data[, position[, encoding]], callback)

This came up while making a library that wraps the Node API to promisify the callback methods; the masked inner signature is impossible to promisify in a generic way, and this problem also affects promisify-node. The inner method should just have its own name; using overloading for it is just unnecessary added complexity.

@bnoordhuis
Copy link
Member

Sorry, but that's not going to happen because of backwards compatibility. You'll have to work around it in your project.

@bnoordhuis bnoordhuis added invalid Issues and PRs that are invalid. feature request Issues that request new features to be added to Node.js. labels May 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. invalid Issues and PRs that are invalid.
Projects
None yet
Development

No branches or pull requests

2 participants