art-standard-lib
Version:
The Standard Library for JavaScript that aught to be.
45 lines (34 loc) • 1.5 kB
JavaScript
// Generated by CoffeeScript 1.12.7
(function() {
var ErrorWithInfo, defineModule, formattedInspect, isFunction, mergeInto, ref,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
defineModule = require('./CommonJs').defineModule;
formattedInspect = require('./Inspect').formattedInspect;
ref = require('./Core'), mergeInto = ref.mergeInto, isFunction = ref.isFunction;
defineModule(module, ErrorWithInfo = (function(superClass) {
extend(ErrorWithInfo, superClass);
function ErrorWithInfo(message, info, name) {
this.info = info;
this.name = name;
ErrorWithInfo.__super__.constructor.apply(this, arguments);
this.name || (this.name = "ErrorWithInfo");
mergeInto(this, this.info);
this.message = message;
if (isFunction(Error.captureStackTrace)) {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = (new Error).stack;
}
}
ErrorWithInfo.prototype.toString = function() {
return [
"ErrorWithInfo: " + this.message, formattedInspect({
info: this.info
})
].join("\n\n");
};
return ErrorWithInfo;
})(Error));
}).call(this);
//# sourceMappingURL=ErrorWithInfo.js.map