module: add API for identifying core 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
Userland example: https://github.com/facebook/jest/pull/4740/files#diff-240429220dd8540b70d06b165fc63ad3R5
/cc @bmeck @addaleax @bengl
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
modules