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 <[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]>
  • 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.