diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-04-18 00:16:22 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-04-30 01:23:33 +0300 |
commit | 723d5c058fa180684df13bd2a83bbf3ca6201957 (patch) | |
tree | 6aeb4bc88e6c437853327cced05ab797827c22f2 /src/inspector_agent.h | |
parent | 095bd569aef4fec433ddb26e681eaabff1f7fd10 (diff) |
src: prefer v8::Global over node::Persistent
`v8::Global` is essentially a nicer variant of `node::Persistent` that,
in addition to reset-on-destroy, also implements move semantics.
This commit makes the necessary replacements, removes
`node::Persistent` and (now-)unnecessary inclusions of the
`node_persistent.h` header, and makes some of the functions that
take Persistents as arguments more generic so that they work with all
`v8::PersistentBase` flavours.
PR-URL: https://github.com/nodejs/node/pull/27287
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/inspector_agent.h')
-rw-r--r-- | src/inspector_agent.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/inspector_agent.h b/src/inspector_agent.h index b079ea675fb..c7c92186d11 100644 --- a/src/inspector_agent.h +++ b/src/inspector_agent.h @@ -7,7 +7,6 @@ #endif #include "node_options-inl.h" -#include "node_persistent.h" #include "v8.h" #include <cstddef> @@ -114,7 +113,7 @@ class Agent { private: void ToggleAsyncHook(v8::Isolate* isolate, - const node::Persistent<v8::Function>& fn); + const v8::Global<v8::Function>& fn); node::Environment* parent_env_; // Encapsulates majority of the Inspector functionality @@ -133,8 +132,8 @@ class Agent { bool pending_enable_async_hook_ = false; bool pending_disable_async_hook_ = false; - node::Persistent<v8::Function> enable_async_hook_function_; - node::Persistent<v8::Function> disable_async_hook_function_; + v8::Global<v8::Function> enable_async_hook_function_; + v8::Global<v8::Function> disable_async_hook_function_; }; } // namespace inspector |