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 <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
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

Lines changed: 1 addition & 1 deletion
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)