Browse Source

src: remove unnecessary calls to Local<T>::New()

v0.11.4-release
Ben Noordhuis 12 years ago
parent
commit
6acde2152f
  1. 2
      src/cares_wrap.cc
  2. 8
      src/node_crypto.cc
  3. 2
      src/node_file.cc
  4. 4
      src/pipe_wrap.cc
  5. 6
      src/tcp_wrap.cc

2
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<Value>::New(node_isolate, Null(node_isolate));
argv[0] = Null(node_isolate);
} else {
// Success
struct addrinfo *address;

8
src/node_crypto.cc

@ -3227,12 +3227,12 @@ void EIO_PBKDF2(uv_work_t* work_req) {
void EIO_PBKDF2After(pbkdf2_req* req, Local<Value> argv[2]) {
if (req->err) {
argv[0] = Local<Value>::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<Value>::New(node_isolate, Undefined(node_isolate));
argv[1] = Undefined(node_isolate);
}
delete[] req->pass;
@ -3401,10 +3401,10 @@ void RandomBytesCheck(RandomBytesRequest* req, Local<Value> argv[2]) {
ERR_error_string_n(req->error_, errmsg, sizeof errmsg);
argv[0] = Exception::Error(String::New(errmsg));
argv[1] = Local<Value>::New(node_isolate, Null(node_isolate));
argv[1] = Null(node_isolate);
}
else {
argv[0] = Local<Value>::New(node_isolate, Null(node_isolate));
argv[0] = Null(node_isolate);
argv[1] = Buffer::Use(req->data_, req->size_);
}
}

2
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<Value>::New(node_isolate, Null(node_isolate));
argv[0] = Null(node_isolate);
// All have at least two args now.
argc = 2;

4
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<Value>::New(node_isolate, Boolean::New(readable)),
Local<Value>::New(node_isolate, Boolean::New(writable))
Boolean::New(readable),
Boolean::New(writable)
};
if (oncomplete_sym.IsEmpty()) {

6
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<Value>::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<Value>::New(node_isolate, v8::True(node_isolate)),
Local<Value>::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);

Loading…
Cancel
Save