forked from electricessence/TypeScript.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathException.js
More file actions
39 lines (39 loc) · 1.54 KB
/
Copy pathException.js
File metadata and controls
39 lines (39 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* @author electricessence / https://github.com/electricessence/
* Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md
* Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx
*/
define(["require", "exports"], function (require, exports) {
///<reference path="Collections/Dictionaries/IDictionary.d.ts"/>
///<reference path="Disposable/IDisposable.d.ts"/>
var NAME = 'Exception';
var Exception = (function () {
function Exception(message, innerException) {
if (message === void 0) { message = null; }
if (innerException === void 0) { innerException = null; }
this.message = message;
var _ = this;
_.name = _.getName();
_.data = {};
if (innerException)
_.data['innerException'] = innerException;
Object.freeze(_);
}
Exception.prototype.getName = function () { return NAME; };
Exception.prototype.toString = function () {
var _ = this, m = _.message;
m = m ? (': ' + m) : '';
return '[' + _.name + m + ']';
};
Exception.prototype.dispose = function () {
var data = this.data;
for (var k in data)
if (data.hasOwnProperty(k))
delete data[k];
};
return Exception;
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Exception;
});
//# sourceMappingURL=Exception.js.map