Skip to content

fix: avoid relying on Node’s internals#166

Merged
raszi merged 1 commit intoraszi:masterfrom
addaleax:no-binding
Jan 28, 2018
Merged

fix: avoid relying on Node’s internals#166
raszi merged 1 commit intoraszi:masterfrom
addaleax:no-binding

Conversation

@addaleax
Copy link
Copy Markdown
Contributor

process.binding() is an internal API of Node, and
its use should be avoided.

Modern versions of Node have constants properties
on the individual public modules, so using these
and falling back to the process.binding() path
ensures that this module is unaffected by
changes to Node’s internals.

`process.binding()` is an internal API of Node, and
its use should be avoided.

Modern versions of Node have `constants` properties
on the individual public modules, so using these
and falling back to the `process.binding()` path
ensures that this module is unaffected by
changes to Node’s internals.
/* istanbul ignore else */
if (opts.discardDescriptor) {
fs.closeSync(fd);
fs.closeSync(fd);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an editor-generated change, let me know if you want me to remove it from this patch

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is fine, thank you!

/* istanbul ignore else */
if (opts.discardDescriptor) {
fs.closeSync(fd);
fs.closeSync(fd);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is fine, thank you!

@raszi raszi merged commit 2df2d04 into raszi:master Jan 28, 2018
@raszi raszi changed the title Avoid relying on Node’s internals fix: avoid relying on Node’s internals Aug 29, 2018
@addaleax addaleax deleted the no-binding branch March 21, 2019 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants