aboutsummaryrefslogtreecommitdiff
path: root/lib/dns.js
diff options
context:
space:
mode:
authorMayhem <stepien.nicolas@gmail.com>2015-03-24 15:15:57 +0100
committerBrendan Ashworth <brendan.ashworth@me.com>2015-03-24 12:42:15 -0700
commit1832743e181149c16ccd3752247f4306d3aa0fe1 (patch)
tree936fa7014782d993aef319599602ecd61c704788 /lib/dns.js
parent7dd5e824be53e222af63cc86e89b7ab7f841901c (diff)
downloadandroid-node-v8-1832743e181149c16ccd3752247f4306d3aa0fe1.tar.gz
android-node-v8-1832743e181149c16ccd3752247f4306d3aa0fe1.tar.bz2
android-node-v8-1832743e181149c16ccd3752247f4306d3aa0fe1.zip
lib: add missing `new` for errors lib/*.js
Not including `new` adds a useless frame and removes a potentially useful frame. PR-URL: https://github.com/iojs/io.js/pull/1246 Reviewed-By: Petka Antonov <petka_antonov@hotmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Diffstat (limited to 'lib/dns.js')
-rw-r--r--lib/dns.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/dns.js b/lib/dns.js
index 4572d253f1..d39eec878e 100644
--- a/lib/dns.js
+++ b/lib/dns.js
@@ -108,12 +108,13 @@ exports.lookup = function lookup(hostname, options, callback) {
// Parse arguments
if (hostname && typeof hostname !== 'string') {
- throw TypeError('invalid arguments: hostname must be a string or falsey');
+ throw new TypeError('invalid arguments: ' +
+ 'hostname must be a string or falsey');
} else if (typeof options === 'function') {
callback = options;
family = 0;
} else if (typeof callback !== 'function') {
- throw TypeError('invalid arguments: callback must be passed');
+ throw new TypeError('invalid arguments: callback must be passed');
} else if (options !== null && typeof options === 'object') {
hints = options.hints >>> 0;
family = options.family >>> 0;