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-04-18 00:16:22 +0300
committerAnna Henningsen <anna@addaleax.net>2019-04-30 01:23:33 +0300
commit723d5c058fa180684df13bd2a83bbf3ca6201957 (patch)
tree6aeb4bc88e6c437853327cced05ab797827c22f2 /src/module_wrap.cc
parent095bd569aef4fec433ddb26e681eaabff1f7fd10 (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/module_wrap.cc')
-rw-r--r--src/module_wrap.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index d6ad0da6224..a4e81dcc294 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -25,6 +25,7 @@ using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
+using v8::Global;
using v8::HandleScope;
using v8::Integer;
using v8::IntegrityLevel;
@@ -611,7 +612,7 @@ Maybe<const PackageConfig*> GetPackageConfig(Environment* env,
env->exports_string()).ToLocal(&exports_v) &&
(exports_v->IsObject() || exports_v->IsString() ||
exports_v->IsBoolean())) {
- Persistent<Value> exports;
+ Global<Value> exports;
exports.Reset(env->isolate(), exports_v);
auto entry = env->package_json_cache.emplace(path,