summaryrefslogtreecommitdiff
path: root/src/env-inl.h
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2019-06-23 08:35:04 -0500
committerJames M Snell <jasnell@gmail.com>2020-02-04 18:29:06 -0800
commit2d8febceef35bdd52624028bdee2e0d58830ae7f (patch)
tree6395d55b837bf0bc9237388f3dc206e63e85fb70 /src/env-inl.h
parent018c3e8949e925efc8077801d44c2b2feb974750 (diff)
downloadnode-new-2d8febceef35bdd52624028bdee2e0d58830ae7f.tar.gz
fs: deprecate closing FileHandle on garbage collection
Closing the FileHandle on garbage collection is a bad practice. Runtime deprecate and indicate that an error will be thrown in the future. PR-URL: https://github.com/nodejs/node/pull/28396 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/env-inl.h')
-rw-r--r--src/env-inl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/env-inl.h b/src/env-inl.h
index 2002df9aba..3c7b83795d 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -888,6 +888,14 @@ inline bool Environment::owns_inspector() const {
return flags_ & kOwnsInspector;
}
+bool Environment::filehandle_close_warning() const {
+ return emit_filehandle_warning_;
+}
+
+void Environment::set_filehandle_close_warning(bool on) {
+ emit_filehandle_warning_ = on;
+}
+
inline uint64_t Environment::thread_id() const {
return thread_id_;
}