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
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-03-06 01:03:24 +0300
committerRuben Bridgewater <ruben@bridgewater.de>2019-03-09 02:27:29 +0300
commit2699f8c860084565a8b3748b3fdf1ebba204f3f7 (patch)
tree35b317504f40d0e3b3a25e5b4205596c41a6b76c /src/node_internals.h
parentc957b0517766729f931a1ef7ab134f75d6a01864 (diff)
src: merge debug-only `SealHandleScope`s
Instead of repeating the same `#ifdef DEBUG` + `SealHandleScope` pattern over and over, create an utility that does this for us. PR-URL: https://github.com/nodejs/node/pull/26459 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/node_internals.h')
-rw-r--r--src/node_internals.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/node_internals.h b/src/node_internals.h
index 166cfd9ea23..212da7af281 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -217,6 +217,20 @@ class InternalCallbackScope {
bool closed_ = false;
};
+class DebugSealHandleScope {
+ public:
+ explicit inline DebugSealHandleScope(v8::Isolate* isolate)
+#ifdef DEBUG
+ : actual_scope_(isolate)
+#endif
+ {}
+
+ private:
+#ifdef DEBUG
+ v8::SealHandleScope actual_scope_;
+#endif
+};
+
class ThreadPoolWork {
public:
explicit inline ThreadPoolWork(Environment* env) : env_(env) {