From 6acde2152fa5cc33ed87825c85ee59bdafd94cf7 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 7 Jul 2013 14:34:49 +0200 Subject: [PATCH] src: remove unnecessary calls to Local::New() --- src/cares_wrap.cc | 2 +- src/node_crypto.cc | 8 ++++---- src/node_file.cc | 2 +- src/pipe_wrap.cc | 4 ++-- src/tcp_wrap.cc | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index f7c67e2d5b..2617ce5097 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -797,7 +797,7 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { if (status) { // Error SetErrno(uv_last_error(uv_default_loop())); - argv[0] = Local::New(node_isolate, Null(node_isolate)); + argv[0] = Null(node_isolate); } else { // Success struct addrinfo *address; diff --git a/src/node_crypto.cc b/src/node_crypto.cc index d60a89cde0..77b1e85351 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3227,12 +3227,12 @@ void EIO_PBKDF2(uv_work_t* work_req) { void EIO_PBKDF2After(pbkdf2_req* req, Local argv[2]) { if (req->err) { - argv[0] = Local::New(node_isolate, Undefined(node_isolate)); + argv[0] = Undefined(node_isolate); argv[1] = Encode(req->key, req->keylen, BUFFER); memset(req->key, 0, req->keylen); } else { argv[0] = Exception::Error(String::New("PBKDF2 error")); - argv[1] = Local::New(node_isolate, Undefined(node_isolate)); + argv[1] = Undefined(node_isolate); } delete[] req->pass; @@ -3401,10 +3401,10 @@ void RandomBytesCheck(RandomBytesRequest* req, Local argv[2]) { ERR_error_string_n(req->error_, errmsg, sizeof errmsg); argv[0] = Exception::Error(String::New(errmsg)); - argv[1] = Local::New(node_isolate, Null(node_isolate)); + argv[1] = Null(node_isolate); } else { - argv[0] = Local::New(node_isolate, Null(node_isolate)); + argv[0] = Null(node_isolate); argv[1] = Buffer::Use(req->data_, req->size_); } } diff --git a/src/node_file.cc b/src/node_file.cc index 1defa6bf22..df99794027 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -121,7 +121,7 @@ static void After(uv_fs_t *req) { } } else { // error value is empty or null for non-error. - argv[0] = Local::New(node_isolate, Null(node_isolate)); + argv[0] = Null(node_isolate); // All have at least two args now. argc = 2; diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index 614191b7b6..3943d34391 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -248,8 +248,8 @@ void PipeWrap::AfterConnect(uv_connect_t* req, int status) { Integer::New(status, node_isolate), wrap->object(), req_wrap_obj, - Local::New(node_isolate, Boolean::New(readable)), - Local::New(node_isolate, Boolean::New(writable)) + Boolean::New(readable), + Boolean::New(writable) }; if (oncomplete_sym.IsEmpty()) { diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index b73600902c..cf7b027175 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -326,7 +326,7 @@ void TCPWrap::OnConnection(uv_stream_t* handle, int status) { argv[0] = client_obj; } else { SetErrno(uv_last_error(uv_default_loop())); - argv[0] = Local::New(node_isolate, Null(node_isolate)); + argv[0] = Null(node_isolate); } MakeCallback(wrap->object(), onconnection_sym, ARRAY_SIZE(argv), argv); @@ -352,8 +352,8 @@ void TCPWrap::AfterConnect(uv_connect_t* req, int status) { Integer::New(status, node_isolate), wrap->object(), req_wrap_obj, - Local::New(node_isolate, v8::True(node_isolate)), - Local::New(node_isolate, v8::True(node_isolate)) + v8::True(node_isolate), + v8::True(node_isolate) }; MakeCallback(req_wrap_obj, oncomplete_sym, ARRAY_SIZE(argv), argv);