Skip to content

Commit a729208

Browse files
targosAli Sheikh
authored and
Ali Sheikh
committed
src: replace usage of deprecated Has
PR-URL: #5159 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 3d7fd9a commit a729208

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/node.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2381,7 +2381,7 @@ static void Binding(const FunctionCallbackInfo<Value>& args) {
23812381
Local<Object> cache = env->binding_cache_object();
23822382
Local<Object> exports;
23832383

2384-
if (cache->Has(module)) {
2384+
if (cache->Has(env->context(), module).FromJust()) {
23852385
exports = cache->Get(module)->ToObject(env->isolate());
23862386
args.GetReturnValue().Set(exports);
23872387
return;

src/node_os.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
217217
name = OneByteString(env->isolate(), raw_name);
218218
#endif
219219

220-
if (ret->Has(name)) {
220+
if (ret->Has(env->context(), name).FromJust()) {
221221
ifarr = Local<Array>::Cast(ret->Get(name));
222222
} else {
223223
ifarr = Array::New(env->isolate());

src/stream_base.cc

+6-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ void StreamBase::AfterShutdown(ShutdownWrap* req_wrap, int status) {
8282
req_wrap_obj
8383
};
8484

85-
if (req_wrap->object()->Has(env->oncomplete_string()))
85+
if (req_wrap->object()->Has(env->context(),
86+
env->oncomplete_string()).FromJust()) {
8687
req_wrap->MakeCallback(env->oncomplete_string(), ARRAY_SIZE(argv), argv);
88+
}
8789

8890
delete req_wrap;
8991
}
@@ -387,8 +389,10 @@ void StreamBase::AfterWrite(WriteWrap* req_wrap, int status) {
387389
wrap->ClearError();
388390
}
389391

390-
if (req_wrap->object()->Has(env->oncomplete_string()))
392+
if (req_wrap->object()->Has(env->context(),
393+
env->oncomplete_string()).FromJust()) {
391394
req_wrap->MakeCallback(env->oncomplete_string(), ARRAY_SIZE(argv), argv);
395+
}
392396

393397
req_wrap->Dispose();
394398
}

0 commit comments

Comments
 (0)