Skip to content

Commit

Permalink
src: only run preloadModules if the preload array is not empty
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
MarshallOfSound authored and BridgeAR committed Jun 17, 2019
1 parent 460cc62 commit a5fdedb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/bootstrap/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
_preloadModules
} = require('internal/modules/cjs/loader');
Expand Down

0 comments on commit a5fdedb

Please sign in to comment.