From 723d5c058fa180684df13bd2a83bbf3ca6201957 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 17 Apr 2019 23:16:22 +0200 Subject: 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 Reviewed-By: Eugene Ostroukhov Reviewed-By: Joyee Cheung Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- src/node_util.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/node_util.cc') diff --git a/src/node_util.cc b/src/node_util.cc index 961df0b73c..180c58c416 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -13,6 +13,7 @@ using v8::Context; using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; +using v8::Global; using v8::IndexFilter; using v8::Integer; using v8::Isolate; @@ -189,7 +190,7 @@ class WeakReference : public BaseObject { SET_NO_MEMORY_INFO() private: - Persistent target_; + Global target_; }; static void GuessHandleType(const FunctionCallbackInfo& args) { -- cgit v1.2.3