Skip to content

Commit

Permalink
src: replace usage of deprecated Has
Browse files Browse the repository at this point in the history
PR-URL: #5159
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
targos authored and Ali Sheikh committed Mar 4, 2016
1 parent 3d7fd9a commit a729208
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2381,7 +2381,7 @@ static void Binding(const FunctionCallbackInfo<Value>& args) {
Local<Object> cache = env->binding_cache_object();
Local<Object> exports;

if (cache->Has(module)) {
if (cache->Has(env->context(), module).FromJust()) {
exports = cache->Get(module)->ToObject(env->isolate());
args.GetReturnValue().Set(exports);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/node_os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
name = OneByteString(env->isolate(), raw_name);
#endif

if (ret->Has(name)) {
if (ret->Has(env->context(), name).FromJust()) {
ifarr = Local<Array>::Cast(ret->Get(name));
} else {
ifarr = Array::New(env->isolate());
Expand Down
8 changes: 6 additions & 2 deletions src/stream_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit a729208

Please sign in to comment.