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

module: add API for identifying core modules #16555

Closed
wants to merge 1 commit into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Oct 27, 2017

There is userland code currently making unsafe use of
process.binding('natives') to identify core modules.
This points to an obvious need for a supported public
API. Let's provide one to discourage userland use of
private APIs

Userland example: https://github.com/facebook/jest/pull/4740/files#diff-240429220dd8540b70d06b165fc63ad3R5

/cc @bmeck @addaleax @bengl

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

modules

There is userland code currently making unsafe use of
`process.binding('natives')` to identify core modules.
This points to an obvious need for a supported public
API. Let's provide one to discourage userland use of
private APIs
@nodejs-github-bot nodejs-github-bot added the module Issues and PRs related to the module subsystem. label Oct 27, 2017
@jasnell jasnell added the semver-minor PRs that contain new features and should be released in the next minor version. label Oct 27, 2017
@cjihrig
Copy link
Contributor

cjihrig commented Oct 27, 2017

Perhaps this should be done as suggestions in #16386?

@jasnell
Copy link
Member Author

jasnell commented Oct 27, 2017

I'd forgotten about that PR! I'll close this one and provide input on that one. Thanks :-)

@jasnell jasnell closed this Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module Issues and PRs related to the module subsystem. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants