aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorForbes Lindesay <forbes@lindesay.co.uk>2013-07-22 01:44:03 +0100
committerForbes Lindesay <forbes@lindesay.co.uk>2013-07-22 01:44:03 +0100
commitdfa395f6ff405bbea018dbc24b31cbd49a9ac6ef (patch)
tree98c1ebce5ab21ebd80fe576c282e38147f8c2fb2
parentb1febde3e9be32b9d88918ed733efc3796e3f143 (diff)
downloadtracifyjs-dfa395f6ff405bbea018dbc24b31cbd49a9ac6ef.tar.gz
tracifyjs-dfa395f6ff405bbea018dbc24b31cbd49a9ac6ef.zip
Make `DefaultsError` a real `Error` object
-rw-r--r--lib/utils.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/utils.js b/lib/utils.js
index 73964a09..20f9a8e1 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -82,9 +82,12 @@ function repeat_string(str, i) {
};
function DefaultsError(msg, defs) {
+ Error.call(this, msg)
this.msg = msg;
this.defs = defs;
};
+DefaultsError.prototype = Object.create(Error.prototype)
+DefaultsError.prototype.constructor = DefaultsError
function defaults(args, defs, croak) {
if (args === true)