lib, tools: remove duplicate requires

PR-URL: https://github.com/nodejs/node/pull/54987
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Aviv Keller 2024-09-25 04:51:28 -04:00 committed by GitHub
parent c6d20a034d
commit 5c22d19f44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 20 additions and 43 deletions

View file

@ -34,6 +34,7 @@ const { kEmptyObject } = require('internal/util');
const {
compileSourceTextModule,
getDefaultConditions,
forceDefaultLoader,
} = require('internal/modules/esm/utils');
const { kImplicitTypeAttribute } = require('internal/modules/esm/assert');
const { ModuleWrap, kEvaluating, kEvaluated } = internalBinding('module_wrap');
@ -798,7 +799,7 @@ function createModuleLoader() {
// Don't spawn a new worker if custom loaders are disabled. For instance, if
// we're already in a worker thread created by instantiating
// CustomizedModuleLoader; doing so would cause an infinite loop.
if (!require('internal/modules/esm/utils').forceDefaultLoader()) {
if (!forceDefaultLoader()) {
const userLoaderPaths = getOptionValue('--experimental-loader');
if (userLoaderPaths.length > 0) {
if (!emittedLoaderFlagWarning) {