Make DefaultsError a real Error object

This commit is contained in:
Forbes Lindesay
2013-07-22 01:44:03 +01:00
parent b1febde3e9
commit dfa395f6ff

View File

@@ -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)