Skip to content

Commit 97a4246

Browse files
MarshallOfSoundantsmartian
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 abf765e commit 97a4246

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
Module: {
391391
_preloadModules

0 commit comments

Comments
 (0)