From 7e255a3bfb67ae8a21a9dc0e1d31ad598bb81903 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Sun, 2 Jun 2019 00:27:17 -0700 Subject: [PATCH] src: only run preloadModules if the preload array is not empty --- lib/internal/bootstrap/pre_execution.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index ed5a5afe4b8072..e9571a89a62857 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -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