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:
authorGabriel Schulhof <gabriel.schulhof@intel.com>2018-11-07 15:09:40 +0300
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-11-13 07:27:40 +0300
commit0603c0a53fc7051260f3f3d3de9582bc3e6af7c9 (patch)
treeeec06e49b87c3f3668c10a2ce6bbb0e55d9a14a7 /src/async_wrap.cc
parentbda4643242159bb74f187614854485d9cfc31bca (diff)
src: bundle persistent-to-local methods as class
Create a class `PersistentToLocal` which contains three methods, `Strong`, `Weak`, and `Default`: * `Strong` returns a `Local` from a strong persistent reference, * `Weak` returns a `Local` from a weak persistent reference, and * `Default` decides based on `IsWeak()` which of the above two to call. These replace `node::StrongPersistentToLocal()`, `node::WeakPersistentToLocal()`, and `node::PersistentToLocal()`, respectively. PR-URL: https://github.com/nodejs/node/pull/24276 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'src/async_wrap.cc')
-rw-r--r--src/async_wrap.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/async_wrap.cc b/src/async_wrap.cc
index 52601ffc8f0..0738cd40099 100644
--- a/src/async_wrap.cc
+++ b/src/async_wrap.cc
@@ -346,7 +346,8 @@ void AsyncWrap::WeakCallback(const v8::WeakCallbackInfo<DestroyParam>& info) {
HandleScope scope(info.GetIsolate());
std::unique_ptr<DestroyParam> p{info.GetParameter()};
- Local<Object> prop_bag = PersistentToLocal(info.GetIsolate(), p->propBag);
+ Local<Object> prop_bag = PersistentToLocal::Default(info.GetIsolate(),
+ p->propBag);
Local<Value> val;
if (!prop_bag->Get(p->env->context(), p->env->destroyed_string())