mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
test_runner: do not expose internal loader
PR-URL: https://github.com/nodejs/node/pull/54106 Fixes: https://github.com/nodejs/node/issues/54071 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
parent
1d35a066e7
commit
d0f5943363
4 changed files with 24 additions and 24 deletions
|
@ -145,13 +145,15 @@ class Hooks {
|
|||
* @param {any} [data] Arbitrary data to be passed from the custom
|
||||
* loader (user-land) to the worker.
|
||||
*/
|
||||
async register(urlOrSpecifier, parentURL, data) {
|
||||
async register(urlOrSpecifier, parentURL, data, isInternal) {
|
||||
const cascadedLoader = require('internal/modules/esm/loader').getOrInitializeCascadedLoader();
|
||||
const keyedExports = await cascadedLoader.import(
|
||||
urlOrSpecifier,
|
||||
parentURL,
|
||||
kEmptyObject,
|
||||
);
|
||||
const keyedExports = isInternal ?
|
||||
require(urlOrSpecifier) :
|
||||
await cascadedLoader.import(
|
||||
urlOrSpecifier,
|
||||
parentURL,
|
||||
kEmptyObject,
|
||||
);
|
||||
await this.addCustomLoader(urlOrSpecifier, keyedExports, data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue