Unverified Commit 84156cf1 authored by Joyee Cheung's avatar Joyee Cheung
Browse files

module: do not share the internal require function with public loaders

This patch removes `NativeModule.require` and
`NativeModule.requireWithFallbackInDeps`. The public loaders now
have to use a special method
`NativeModule.prototype.compileForPublicLoader()` to compile native
modules. In addition this patch moves the decisions of proxifying
exports and throwing unknown builtin errors entirely to public
loaders, and skip those during internal use - therefore `loaders.js`,
which is compiled during bootstrap, no longer needs to be aware of
the value of `--experimental-modules`.

PR-URL: https://github.com/nodejs/node/pull/26549


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 5fc6c1da
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment