From 06953df051237d322a9c7c49d9c913fd0f9e330c 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 27a9a01c7c2170..41eeb1e0ef5710 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 15b83ec91f6387..eb75fdc8339ab8 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"