From: Mihai Bazon Date: Tue, 10 Dec 2013 18:23:29 +0000 (-0800) Subject: Merge pull request #245 from ForbesLindesay/patch-1 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=248f304f02528f1e63c11707f3159e456baac139;p=UglifyJS.git Merge pull request #245 from ForbesLindesay/patch-1 Make `DefaultsError` a real `Error` object --- 248f304f02528f1e63c11707f3159e456baac139 diff --cc lib/utils.js index fa24663c,20f9a8e1..c7299e57 --- a/lib/utils.js +++ b/lib/utils.js @@@ -85,11 -86,9 +86,13 @@@ function DefaultsError(msg, defs) 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); +}; + function defaults(args, defs, croak) { if (args === true) args = {};