Skip to content

Commit a5fdedb

Browse files
MarshallOfSoundBridgeAR
authored andcommitted
src: only run preloadModules if the preload array is not empty
PR-URL: #28012 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 460cc62 commit a5fdedb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/bootstrap/pre_execution.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ function initializeFrozenIntrinsics() {
385385
function loadPreloadModules() {
386386
// For user code, we preload modules if `-r` is passed
387387
const preloadModules = getOptionValue('--require');
388-
if (preloadModules) {
388+
if (preloadModules && preloadModules.length > 0) {
389389
const {
390390
_preloadModules
391391
} = require('internal/modules/cjs/loader');

0 commit comments

Comments
 (0)