diff --git a/src/file.cc b/src/file.cc index d3c9dec543..d43cde649b 100644 --- a/src/file.cc +++ b/src/file.cc @@ -450,10 +450,7 @@ Handle File::New(const Arguments& args) { HandleScope scope; - File *file = new File(args.Holder()); - if(file == NULL) - return Undefined(); // XXX raise error? - + new File(args.Holder()); return args.This(); } diff --git a/src/net.cc b/src/net.cc index 0b42ffe72b..fe972a51da 100644 --- a/src/net.cc +++ b/src/net.cc @@ -54,9 +54,7 @@ Server::New (const Arguments& args) if (args.Length() > 0 && args[0]->IsNumber()) backlog = args[0]->IntegerValue(); - Server *server = new Server(args.Holder(), backlog); - if(server == NULL) - return Undefined(); // XXX raise error? + new Server(args.Holder(), backlog); return args.This(); } @@ -165,9 +163,7 @@ Socket::New(const Arguments& args) } } - Socket *s = new Socket(args.Holder(), timeout); - if(s == NULL) - return Undefined(); // XXX raise error? + new Socket(args.Holder(), timeout); return args.This(); } diff --git a/src/timer.cc b/src/timer.cc index 1d6c504733..1e6f0bbf51 100644 --- a/src/timer.cc +++ b/src/timer.cc @@ -68,9 +68,9 @@ Timer::New (const Arguments& args) ev_tstamp after = (double)(args[1]->IntegerValue()) / 1000.0; ev_tstamp repeat = (double)(args[2]->IntegerValue()) / 1000.0; - Timer *timer = new Timer(args.Holder(), callback, after, repeat); + new Timer(args.Holder(), callback, after, repeat); - return scope.Close(timer->handle_); + return args.This(); } Handle