Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorShelley Vohr <shelley.vohr@gmail.com>2022-02-24 02:32:30 +0300
committerGitHub <noreply@github.com>2022-02-24 02:32:30 +0300
commit0367b5c35ea0f98b323175a4aaa8e651af7a91e7 (patch)
tree7df0351688e59aa7fd8d90e7585486dbe9d753cb /src/api
parent7efef7458573281db07327bbc3408f7806466468 (diff)
src: allow preventing InitializeInspector in env
PR-URL: https://github.com/nodejs/node/pull/35025 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/api')
-rw-r--r--src/api/environment.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/api/environment.cc b/src/api/environment.cc
index 1ec1e8bc8c1..e3e90dbad98 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -344,12 +344,14 @@ Environment* CreateEnvironment(
Environment* env = new Environment(
isolate_data, context, args, exec_args, nullptr, flags, thread_id);
#if HAVE_INSPECTOR
- if (inspector_parent_handle) {
- env->InitializeInspector(
- std::move(static_cast<InspectorParentHandleImpl*>(
- inspector_parent_handle.get())->impl));
- } else {
- env->InitializeInspector({});
+ if (env->should_create_inspector()) {
+ if (inspector_parent_handle) {
+ env->InitializeInspector(
+ std::move(static_cast<InspectorParentHandleImpl*>(
+ inspector_parent_handle.get())->impl));
+ } else {
+ env->InitializeInspector({});
+ }
}
#endif