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:
parent
7b9771f569
commit
b84ebfe886
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user