Skip to content

Commit

Permalink
src: add env and cli option to disable global search paths
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Sep 24, 2021
1 parent 43bf468 commit 83c15bc
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions patches/node/fix_allow_preventing_initializeinspector_in_env.patch
Expand Up @@ -36,11 +36,11 @@ index 523d252e08974a10f9a53fb46d3345669cec3380..5bf19a0dda42849159d954181058897c
#endif

diff --git a/src/env-inl.h b/src/env-inl.h
index 061897d95d8b5f61968c59260e609d7be724b88f..7c7ee3207089bf3e51db646a367bdd6deba18628 100644
index 2b000ed9ace5f73bfe0e8cab3e83ce94804f9c55..a1690712c457534d70db777cb722537913f86a0e 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -881,6 +881,10 @@ inline bool Environment::hide_console_windows() const {
return flags_ & EnvironmentFlags::kHideConsoleWindows;
@@ -891,6 +891,10 @@ inline bool Environment::no_global_search_paths() const {
!options_->global_search_paths;
}

+inline bool Environment::should_initialize_inspector() const {
Expand All @@ -51,31 +51,31 @@ index 061897d95d8b5f61968c59260e609d7be724b88f..7c7ee3207089bf3e51db646a367bdd6d
return emit_filehandle_warning_;
}
diff --git a/src/env.h b/src/env.h
index 4fd5be8e15029b65d61982aa32eba2cd27957fce..b38a69fc06a189569524df767dbbbe5c1985aa20 100644
index f055e6b45013d9f8c039c662981bfd54f08266f6..d31512ae37fba212a20cf306be46f7dfadeabd6a 100644
--- a/src/env.h
+++ b/src/env.h
@@ -1202,6 +1202,7 @@ class Environment : public MemoryRetainer {
inline bool owns_inspector() const;
@@ -1204,6 +1204,7 @@ class Environment : public MemoryRetainer {
inline bool tracks_unmanaged_fds() const;
inline bool hide_console_windows() const;
inline bool no_global_search_paths() const;
+ inline bool should_initialize_inspector() const;
inline uint64_t thread_id() const;
inline worker::Worker* worker_context() const;
Environment* worker_parent_env() const;
diff --git a/src/node.h b/src/node.h
index b7f3e97873ef90b635e0648639f1a287a0bd88fa..48e378079f6d05e7cc1141a8875450b125028789 100644
index 364f789fbcbec8e3234961294698d8e69b04a310..85b5ac6a5a5cb5e4388a92a1d07c9afe17140a8c 100644
--- a/src/node.h
+++ b/src/node.h
@@ -409,7 +409,11 @@ enum Flags : uint64_t {
// Set this flag to force hiding console windows when spawning child
// processes. This is usually used when embedding Node.js in GUI programs on
// Windows.
- kHideConsoleWindows = 1 << 5
+ kHideConsoleWindows = 1 << 5,
@@ -420,7 +420,11 @@ enum Flags : uint64_t {
// $HOME/.node_modules and $NODE_PATH. This is used by standalone apps that
// do not expect to have their behaviors changed because of globally
// installed modules.
- kNoGlobalSearchPaths = 1 << 7
+ kNoGlobalSearchPaths = 1 << 7,
+ // Controls whether or not the Environment should call InitializeInspector.
+ // This control is needed by embedders who may not want to initialize the V8
+ // inspector in situations where it already exists.
+ kNoInitializeInspector = 1 << 6
+ kNoInitializeInspector = 1 << 8
};
} // namespace EnvironmentFlags

0 comments on commit 83c15bc

Please sign in to comment.