diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-04-17 23:16:22 +0200 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2019-04-30 08:17:33 +0200 |
commit | 33702913b1136607b1f0859375f3d2fa939fbb29 (patch) | |
tree | 48e8e5ebc02cb0ab4de18404684f7a9fc3cf6799 /src/heap_utils.cc | |
parent | eeab007b25bc7ac2225e49c13db6c7ccf1975b53 (diff) | |
download | android-node-v8-33702913b1136607b1f0859375f3d2fa939fbb29.tar.gz android-node-v8-33702913b1136607b1f0859375f3d2fa939fbb29.tar.bz2 android-node-v8-33702913b1136607b1f0859375f3d2fa939fbb29.zip |
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/heap_utils.cc')
-rw-r--r-- | src/heap_utils.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/heap_utils.cc b/src/heap_utils.cc index d5b5afa4d5..654dfabafe 100644 --- a/src/heap_utils.cc +++ b/src/heap_utils.cc @@ -8,6 +8,7 @@ using v8::EmbedderGraph; using v8::EscapableHandleScope; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; +using v8::Global; using v8::HandleScope; using v8::HeapSnapshot; using v8::Isolate; @@ -56,7 +57,7 @@ class JSGraphJSNode : public EmbedderGraph::Node { }; private: - Persistent<Value> persistent_; + Global<Value> persistent_; }; class JSGraph : public EmbedderGraph { |