node/lib/internal/modules/esm
Joyee Cheung 235bb733a6
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: James M Snell <jasnell@gmail.com>
2019-03-27 22:16:25 +01:00
..
create_dynamic_module.js lib: simplify several debug() calls 2019-01-01 14:38:20 +01:00
default_resolve.js src: simplify NativeModule caching and remove redundant data 2019-02-09 01:24:24 +01:00
loader.js module: remove usage of require('util') in esm/loader.js 2019-03-27 22:16:19 +01:00
module_job.js lib: replace 'assert' with 'internal/assert' for many built-ins 2019-02-10 20:03:16 +01:00
module_map.js module: remove usage of require('util') 2019-03-27 22:16:17 +01:00
translators.js module: do not share the internal require function with public loaders 2019-03-27 22:16:25 +01:00