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/async_wrap.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/async_wrap.cc') diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 9cfa0924c7..e822255265 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -35,6 +35,7 @@ using v8::EscapableHandleScope; using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; +using v8::Global; using v8::HandleScope; using v8::Integer; using v8::Isolate; @@ -346,8 +347,8 @@ class DestroyParam { public: double asyncId; Environment* env; - Persistent target; - Persistent propBag; + Global target; + Global propBag; }; void AsyncWrap::WeakCallback(const WeakCallbackInfo& info) { -- cgit v1.2.3