Check for callback argument in PTR lookup

This commit is contained in:
Krishna Rajendran authored and Ryan Dahl committed 2010-03-17 00:46:44 -07:00
1 parent 31ed37fdf0
commit 84277ea845
2 files changed
+9 -1

No files matched your search

+5
View File
@@ -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 {
+4 -1
View File
@@ -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',