extendo-error
Version:
Safely and simply extend native Error with prototype chaining support
38 lines (37 loc) • 1.21 kB
JavaScript
;
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var _1 = require("./");
var GrandChildError = (function (_super) {
__extends(GrandChildError, _super);
function GrandChildError() {
var _this = _super.apply(this, arguments) || this;
_this.fieldA = "A";
_this.fieldB = "B";
return _this;
}
GrandChildError.prototype.functionA = function () {
};
GrandChildError.prototype.functionB = function () {
};
Object.defineProperty(GrandChildError.prototype, "propertyA", {
get: function () {
return "a";
},
enumerable: true,
configurable: true
});
Object.defineProperty(GrandChildError.prototype, "propertyB", {
get: function () {
return "b";
},
enumerable: true,
configurable: true
});
return GrandChildError;
}(_1.ChildError));
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = GrandChildError;