dns: verify argument is valid function in resolve
authorKenan Sulayman <kenan@sly.mn>
Fri, 7 Feb 2014 17:18:27 +0000 (18:18 +0100)
committerFedor Indutny <fedor.indutny@gmail.com>
Sun, 9 Feb 2014 09:37:50 +0000 (13:37 +0400)
commitabe4c34c86ccbe06ff4ecd50774c0205009d4620
treec48e68ebf7db766a5fa4d0f9046945d957fcf65b
parente3ec2f7dabb08fbe66b1f1ec92ddabe71499e5b6
dns: verify argument is valid function in resolve

Don't use argument as callback if it's not a valid callback function.
Throw a valid exception instead explaining the issue.

Adds to #7070 ("DNS — Throw meaningful error(s)").
lib/dns.js
test/simple/test-dns.js