Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream_base: homogenize req_wrap_obj use #10184

Closed
wants to merge 7 commits into from
Closed
Changes from 5 commits
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
13 changes: 6 additions & 7 deletions src/stream_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void StreamBase::AfterShutdown(ShutdownWrap* req_wrap, int status) {
req_wrap_obj
};

if (req_wrap->object()->Has(env->context(),
if (req_wrap_obj->Has(env->context(),
env->oncomplete_string()).FromJust()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alignment. :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

req_wrap->MakeCallback(env->oncomplete_string(), arraysize(argv), argv);
}
Expand Down Expand Up @@ -172,9 +172,8 @@ int StreamBase::Writev(const FunctionCallbackInfo<Value>& args) {

int err = DoWrite(req_wrap, *bufs, count, nullptr);

req_wrap->object()->Set(env->async(), True(env->isolate()));
req_wrap->object()->Set(env->bytes_string(),
Number::New(env->isolate(), bytes));
req_wrap_obj->Set(env->async(), True(env->isolate()));
req_wrap_obj->Set(env->bytes_string(), Number::New(env->isolate(), bytes));
const char* msg = Error();
if (msg != nullptr) {
req_wrap_obj->Set(env->error_string(), OneByteString(env->isolate(), msg));
Expand Down Expand Up @@ -328,7 +327,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) {
// Reference StreamWrap instance to prevent it from being garbage
// collected before `AfterWrite` is called.
CHECK_EQ(false, req_wrap->persistent().IsEmpty());
req_wrap->object()->Set(env->handle_string(), send_handle_obj);
req_wrap_obj->Set(env->handle_string(), send_handle_obj);
}

err = DoWrite(
Expand All @@ -338,7 +337,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) {
reinterpret_cast<uv_stream_t*>(send_handle));
}

req_wrap->object()->Set(env->async(), True(env->isolate()));
req_wrap_obj->Set(env->async(), True(env->isolate()));

if (err)
req_wrap->Dispose();
Expand Down Expand Up @@ -383,7 +382,7 @@ void StreamBase::AfterWrite(WriteWrap* req_wrap, int status) {
wrap->ClearError();
}

if (req_wrap->object()->Has(env->context(),
if (req_wrap_obj->Has(env->context(),
env->oncomplete_string()).FromJust()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And again.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

req_wrap->MakeCallback(env->oncomplete_string(), arraysize(argv), argv);
}
Expand Down