src: fix Get() usage in async_wrap.cc

PR-URL: https://github.com/nodejs/node/pull/24060
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
pull/24060/head
cjihrig 2018-11-03 10:41:10 -04:00
parent c3809ffc24
commit 312baacd93
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5
1 changed files with 6 additions and 1 deletions

View File

@ -347,8 +347,13 @@ void AsyncWrap::WeakCallback(const v8::WeakCallbackInfo<DestroyParam>& info) {
std::unique_ptr<DestroyParam> p{info.GetParameter()};
Local<Object> prop_bag = PersistentToLocal(info.GetIsolate(), p->propBag);
Local<Value> val;
if (!prop_bag->Get(p->env->context(), p->env->destroyed_string())
.ToLocal(&val)) {
return;
}
Local<Value> val = prop_bag->Get(p->env->destroyed_string());
if (val->IsFalse()) {
AsyncWrap::EmitDestroy(p->env, p->asyncId);
}