From a729208808e88279961128505730d33450fa358e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Mon, 8 Feb 2016 22:54:00 +0100 Subject: [PATCH] src: replace usage of deprecated Has PR-URL: https://github.com/nodejs/node/pull/5159 Reviewed-By: Ben Noordhuis --- src/node.cc | 2 +- src/node_os.cc | 2 +- src/stream_base.cc | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/node.cc b/src/node.cc index 74a4497f73cf1f..31aa331c4f4ac7 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2381,7 +2381,7 @@ static void Binding(const FunctionCallbackInfo& args) { Local cache = env->binding_cache_object(); Local exports; - if (cache->Has(module)) { + if (cache->Has(env->context(), module).FromJust()) { exports = cache->Get(module)->ToObject(env->isolate()); args.GetReturnValue().Set(exports); return; diff --git a/src/node_os.cc b/src/node_os.cc index 92f53a9c407fae..f432702792fc0a 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -217,7 +217,7 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo& args) { name = OneByteString(env->isolate(), raw_name); #endif - if (ret->Has(name)) { + if (ret->Has(env->context(), name).FromJust()) { ifarr = Local::Cast(ret->Get(name)); } else { ifarr = Array::New(env->isolate()); diff --git a/src/stream_base.cc b/src/stream_base.cc index 42214bcdc256b5..648c6d3aa59941 100644 --- a/src/stream_base.cc +++ b/src/stream_base.cc @@ -82,8 +82,10 @@ void StreamBase::AfterShutdown(ShutdownWrap* req_wrap, int status) { req_wrap_obj }; - if (req_wrap->object()->Has(env->oncomplete_string())) + if (req_wrap->object()->Has(env->context(), + env->oncomplete_string()).FromJust()) { req_wrap->MakeCallback(env->oncomplete_string(), ARRAY_SIZE(argv), argv); + } delete req_wrap; } @@ -387,8 +389,10 @@ void StreamBase::AfterWrite(WriteWrap* req_wrap, int status) { wrap->ClearError(); } - if (req_wrap->object()->Has(env->oncomplete_string())) + if (req_wrap->object()->Has(env->context(), + env->oncomplete_string()).FromJust()) { req_wrap->MakeCallback(env->oncomplete_string(), ARRAY_SIZE(argv), argv); + } req_wrap->Dispose(); }