src: only run preloadModules if the preload array is not empty
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
abf765e33c
commit
97a42465ab
@ -385,7 +385,7 @@ function initializeFrozenIntrinsics() {
|
||||
function loadPreloadModules() {
|
||||
// For user code, we preload modules if `-r` is passed
|
||||
const preloadModules = getOptionValue('--require');
|
||||
if (preloadModules) {
|
||||
if (preloadModules && preloadModules.length > 0) {
|
||||
const {
|
||||
Module: {
|
||||
_preloadModules
|
||||
|
Loading…
x
Reference in New Issue
Block a user