Skip to content

Commit

Permalink
src,win: fix usage of deprecated v8::Object::Set
Browse files Browse the repository at this point in the history
PR-URL: #26735
Refs: #26733
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
targos committed Mar 27, 2019
1 parent eafbfad commit 8ba0da5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/api/exceptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,22 @@ Local<Value> WinapiErrnoException(Isolate* isolate,
}

Local<Object> obj = e.As<Object>();
obj->Set(env->errno_string(), Integer::New(isolate, errorno));
obj->Set(env->context(), env->errno_string(), Integer::New(isolate, errorno))
.FromJust();

if (path != nullptr) {
obj->Set(env->path_string(),
obj->Set(env->context(),
env->path_string(),
String::NewFromUtf8(isolate, path, NewStringType::kNormal)
.ToLocalChecked());
.ToLocalChecked())
.FromJust();
}

if (syscall != nullptr) {
obj->Set(env->syscall_string(), OneByteString(isolate, syscall));
obj->Set(env->context(),
env->syscall_string(),
OneByteString(isolate, syscall))
.FromJust();
}

if (must_free)
Expand Down

0 comments on commit 8ba0da5

Please sign in to comment.