mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Check for callback argument in PTR lookup
This commit is contained in:
committed by
Ryan Dahl
parent
31ed37fdf0
commit
84277ea845
@@ -443,6 +443,11 @@ static Handle<Value> Reverse(const Arguments& args) {
|
||||
String::New("Argument must be a string.")));
|
||||
}
|
||||
|
||||
if (!args[1]->IsFunction()) {
|
||||
return ThrowException(Exception::Error(
|
||||
String::New("Missing callback argument")));
|
||||
}
|
||||
|
||||
String::Utf8Value ip_address(args[0]->ToString());
|
||||
|
||||
union {
|
||||
|
||||
@@ -8,7 +8,10 @@ var dns = require("dns"),
|
||||
|
||||
assert.throws(function () {
|
||||
dns.resolve('google.com', 'A');
|
||||
})
|
||||
});
|
||||
assert.throws(function () {
|
||||
dns.resolve('127.0.0.1', 'PTR');
|
||||
});
|
||||
|
||||
|
||||
var hosts = ['example.com', 'example.org',
|
||||
|
||||
Reference in New Issue
Block a user