From 12a2997bed0efa80d17b498d28c2186b6f73bdaf Mon Sep 17 00:00:00 2001 From: Nick Kreeger Date: Sun, 15 Mar 2020 20:22:33 -0700 Subject: [PATCH] src: fix extra includes of "env.h" and "env-inl.h" Due to how the Environment class is used throughout the codebase, there are a log of includes referencing eitehr env.h or env-inl.h. This commit cleans up the remaining extra includes of 'env.h' or 'env-inl.h' and adds forward declarations of the Environment class. PR-URL: https://github.com/nodejs/node/pull/32293 Refs: https://github.com/nodejs/node/issues/27531 Fixes: https://github.com/nodejs/node/issues/27531 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- src/node_crypto_common.h | 1 - src/node_sockaddr.h | 3 ++- src/stream_base-inl.h | 5 ++--- src/stream_base.h | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/node_crypto_common.h b/src/node_crypto_common.h index e42e249ef2ba2e..8d40052bcca2f9 100644 --- a/src/node_crypto_common.h +++ b/src/node_crypto_common.h @@ -3,7 +3,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "env.h" #include "node_crypto.h" #include "v8.h" #include diff --git a/src/node_sockaddr.h b/src/node_sockaddr.h index 2e3ae09ce3bb8d..c0d006a4d6e681 100644 --- a/src/node_sockaddr.h +++ b/src/node_sockaddr.h @@ -3,7 +3,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "env.h" #include "memory_tracker.h" #include "node.h" #include "uv.h" @@ -14,6 +13,8 @@ namespace node { +class Environment; + class SocketAddress : public MemoryRetainer { public: struct Hash { diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index d365c550ce4838..95152e34915853 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -3,10 +3,9 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "stream_base.h" - +#include "async_wrap-inl.h" #include "node.h" -#include "env-inl.h" +#include "stream_base.h" #include "v8.h" namespace node { diff --git a/src/stream_base.h b/src/stream_base.h index c0c3c0f6c4ac55..176271e05a8c39 100644 --- a/src/stream_base.h +++ b/src/stream_base.h @@ -3,7 +3,8 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "async_wrap-inl.h" +#include "env.h" +#include "async_wrap.h" #include "node.h" #include "util.h"