mirror of https://github.com/nodejs/node.git
Accept ports represented as strings
parent
d77f757745
commit
b3b6f8c02e
|
@ -196,7 +196,7 @@ Connection::Connect (const Arguments& args)
|
||||||
connection->Init(); // in case we're reusing the socket... ?
|
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."));
|
return ThrowException(String::New("Must specify a port."));
|
||||||
|
|
||||||
String::AsciiValue port_sv(args[0]->ToString());
|
String::AsciiValue port_sv(args[0]->ToString());
|
||||||
|
@ -692,7 +692,7 @@ Acceptor::Listen (const Arguments& args)
|
||||||
Acceptor *acceptor = NODE_UNWRAP(Acceptor, args.Holder());
|
Acceptor *acceptor = NODE_UNWRAP(Acceptor, args.Holder());
|
||||||
if (!acceptor) return Handle<Value>();
|
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."));
|
return ThrowException(String::New("Must give at least a port as argument."));
|
||||||
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
Loading…
Reference in New Issue