Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a729208

Browse filesBrowse files
targosAli Sheikh
authored andcommitted
src: replace usage of deprecated Has
PR-URL: #5159 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 3d7fd9a commit a729208
Copy full SHA for a729208

File tree

Expand file treeCollapse file tree

3 files changed

+8
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+8
-4
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+1-1Lines changed: 1 addition & 1 deletion
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;
Collapse file

‎src/node_os.cc‎

Copy file name to clipboardExpand all lines: src/node_os.cc
+1-1Lines changed: 1 addition & 1 deletion
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());
Collapse file

‎src/stream_base.cc‎

Copy file name to clipboardExpand all lines: src/stream_base.cc
+6-2Lines changed: 6 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.