From a0d7430b6281e2fec5b6b2e52f3ff8b76542c58b Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Sun, 2 Jun 2019 00:27:17 -0700 Subject: [PATCH 1/2] 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 b8ea75d2850..582579cccf0 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -358,7 +358,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'); From a42588cd068ec722255b1cfe5fcbd7262649b931 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Sun, 2 Jun 2019 12:43:59 -0700 Subject: [PATCH 2/2] src: read break_node_first_line from the inspect options There are cases where the debug_options() on the env are different to the options that were passed into inspector::Agent. --- src/node.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index 6f07d07a7bc..2f2b52e1336 100644 --- a/src/node.cc +++ b/src/node.cc @@ -286,7 +286,7 @@ MaybeLocal RunBootstrapping(Environment* env) { }; #if HAVE_INSPECTOR - if (env->options()->debug_options().break_node_first_line) { + if (env->inspector_agent()->options().break_node_first_line) { env->inspector_agent()->PauseOnNextJavascriptStatement( "Break at bootstrap"); }