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.
This commit is contained in:
Trevor Norris 2014-03-17 14:39:37 -07:00
parent 7b9771f569
commit b84ebfe886

View File

@ -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);