diff options
author | Samuel Attard <samuel.r.attard@gmail.com> | 2019-06-02 00:27:17 -0700 |
---|---|---|
committer | Anto Aravinth <anto.aravinth.cse@gmail.com> | 2019-06-09 14:33:28 +0530 |
commit | 97a42465ab6f2e1cce33ca7a0d9cc6e8eea145f9 (patch) | |
tree | 5309c75121c39a4d260c890e1573373b9c2bda3c /lib/internal | |
parent | abf765e33c658d300d746c070b70ec79ae5961ac (diff) | |
download | android-node-v8-97a42465ab6f2e1cce33ca7a0d9cc6e8eea145f9.tar.gz android-node-v8-97a42465ab6f2e1cce33ca7a0d9cc6e8eea145f9.tar.bz2 android-node-v8-97a42465ab6f2e1cce33ca7a0d9cc6e8eea145f9.zip |
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>
Diffstat (limited to 'lib/internal')
-rw-r--r-- | lib/internal/bootstrap/pre_execution.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index ed5a5afe4b..e9571a89a6 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 |