diff options
author | Ryan <ry@tinyclouds.org> | 2009-06-17 10:16:48 +0200 |
---|---|---|
committer | Ryan <ry@tinyclouds.org> | 2009-06-17 10:16:48 +0200 |
commit | b3b6f8c02efcd9f513045a6b532f51082e187f17 (patch) | |
tree | cf4a4a2ddc38f9d2d86c038ab1cf3c3c0468e05b | |
parent | d77f75774516fc9dfefe6c6523a94960df5100b5 (diff) | |
download | nodejs-b3b6f8c02efcd9f513045a6b532f51082e187f17.tar.gz nodejs-b3b6f8c02efcd9f513045a6b532f51082e187f17.tar.bz2 nodejs-b3b6f8c02efcd9f513045a6b532f51082e187f17.zip |
Accept ports represented as strings
-rw-r--r-- | src/net.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net.cc b/src/net.cc index c4213667c..8148937c1 100644 --- a/src/net.cc +++ b/src/net.cc @@ -196,7 +196,7 @@ Connection::Connect (const Arguments& args) connection->Init(); // in case we're reusing the socket... ? } - if (args.Length() == 0 || args[0]->IsInt32() == false) + if (args.Length() == 0) return ThrowException(String::New("Must specify a port.")); String::AsciiValue port_sv(args[0]->ToString()); @@ -692,7 +692,7 @@ Acceptor::Listen (const Arguments& args) Acceptor *acceptor = NODE_UNWRAP(Acceptor, args.Holder()); if (!acceptor) return Handle<Value>(); - if (args.Length() < 1) + if (args.Length() == 0) return ThrowException(String::New("Must give at least a port as argument.")); HandleScope scope; |