@@ -82,10 +82,8 @@ void StreamBase::AfterShutdown(ShutdownWrap* req_wrap, int status) {
8282 req_wrap_obj
8383 };
8484
85- if (req_wrap->object ()->Has (env->context (),
86- env->oncomplete_string ()).FromJust ()) {
85+ if (req_wrap_obj->Has (env->context (), env->oncomplete_string ()).FromJust ())
8786 req_wrap->MakeCallback (env->oncomplete_string (), arraysize (argv), argv);
88- }
8987
9088 delete req_wrap;
9189}
@@ -172,9 +170,8 @@ int StreamBase::Writev(const FunctionCallbackInfo<Value>& args) {
172170
173171 int err = DoWrite (req_wrap, *bufs, count, nullptr );
174172
175- req_wrap->object ()->Set (env->async (), True (env->isolate ()));
176- req_wrap->object ()->Set (env->bytes_string (),
177- Number::New (env->isolate (), bytes));
173+ req_wrap_obj->Set (env->async (), True (env->isolate ()));
174+ req_wrap_obj->Set (env->bytes_string (), Number::New (env->isolate (), bytes));
178175 const char * msg = Error ();
179176 if (msg != nullptr ) {
180177 req_wrap_obj->Set (env->error_string (), OneByteString (env->isolate (), msg));
@@ -328,7 +325,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) {
328325 // Reference StreamWrap instance to prevent it from being garbage
329326 // collected before `AfterWrite` is called.
330327 CHECK_EQ (false , req_wrap->persistent ().IsEmpty ());
331- req_wrap-> object () ->Set (env->handle_string (), send_handle_obj);
328+ req_wrap_obj ->Set (env->handle_string (), send_handle_obj);
332329 }
333330
334331 err = DoWrite (
@@ -338,7 +335,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) {
338335 reinterpret_cast <uv_stream_t *>(send_handle));
339336 }
340337
341- req_wrap-> object () ->Set (env->async (), True (env->isolate ()));
338+ req_wrap_obj ->Set (env->async (), True (env->isolate ()));
342339
343340 if (err)
344341 req_wrap->Dispose ();
@@ -383,10 +380,8 @@ void StreamBase::AfterWrite(WriteWrap* req_wrap, int status) {
383380 wrap->ClearError ();
384381 }
385382
386- if (req_wrap->object ()->Has (env->context (),
387- env->oncomplete_string ()).FromJust ()) {
383+ if (req_wrap_obj->Has (env->context (), env->oncomplete_string ()).FromJust ())
388384 req_wrap->MakeCallback (env->oncomplete_string (), arraysize (argv), argv);
389- }
390385
391386 req_wrap->Dispose ();
392387}
0 commit comments