Merge pull request #245 from ForbesLindesay/patch-1

Make `DefaultsError` a real `Error` object
This commit is contained in:
Mihai Bazon
2013-12-10 10:23:29 -08:00

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
DefaultsError.croak = function(msg, defs) {
throw new DefaultsError(msg, defs);