Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
src: pass along errors from StreamBase req obj creations
  • Loading branch information
addaleax committed Jan 30, 2019
commit ce8dcae3a540cb647f183a2cafeceff2a7c9f16c
16 changes: 10 additions & 6 deletions src/stream_base-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,11 @@ inline int StreamBase::Shutdown(v8::Local<v8::Object> req_wrap_obj) {
HandleScope handle_scope(env->isolate());

if (req_wrap_obj.IsEmpty()) {
req_wrap_obj =
env->shutdown_wrap_template()
->NewInstance(env->context()).ToLocalChecked();
if (!env->shutdown_wrap_template()
->NewInstance(env->context())
.ToLocal(&req_wrap_obj)) {
return UV_EBUSY;
}
StreamReq::ResetObject(req_wrap_obj);
}

Expand Down Expand Up @@ -211,9 +213,11 @@ inline StreamWriteResult StreamBase::Write(
HandleScope handle_scope(env->isolate());

if (req_wrap_obj.IsEmpty()) {
req_wrap_obj =
env->write_wrap_template()
->NewInstance(env->context()).ToLocalChecked();
if (!env->write_wrap_template()
->NewInstance(env->context())
.ToLocal(&req_wrap_obj)) {
return StreamWriteResult { false, UV_EBUSY, nullptr, 0 };
}
StreamReq::ResetObject(req_wrap_obj);
}

Expand Down