Permalink
Browse files

pipe_wrap: use Instantiate() method

Retrieve a new client object via PipeWrap::Instantiate(). This method
performs appropriate checks to make sure everything is as it should be.
  • Loading branch information...
1 parent 7b9771f commit b84ebfe8860edfb83bff945c30d41e2d9c32dfca @trevnorris trevnorris committed Mar 17, 2014
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/pipe_wrap.cc
View
@@ -206,8 +206,7 @@ void PipeWrap::OnConnection(uv_stream_t* handle, int status) {
}
// Instanciate the client javascript object and handle.
- Local<Object> client_obj =
- env->pipe_constructor_template()->GetFunction()->NewInstance();
+ Local<Object> client_obj = Instantiate(env);
// Unwrap the client javascript object.
PipeWrap* wrap = Unwrap<PipeWrap>(client_obj);

0 comments on commit b84ebfe

Please sign in to comment.