Break exception class out into a standalone module
This commit is contained in:
@@ -1,19 +1,6 @@
|
||||
var toString = Object.prototype.toString,
|
||||
isArray = Array.isArray;
|
||||
|
||||
var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
|
||||
|
||||
export function Exception(message) {
|
||||
var tmp = Error.prototype.constructor.apply(this, arguments);
|
||||
|
||||
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
|
||||
for (var idx = 0; idx < errorProps.length; idx++) {
|
||||
this[errorProps[idx]] = tmp[errorProps[idx]];
|
||||
}
|
||||
};
|
||||
|
||||
Exception.prototype = new Error();
|
||||
|
||||
// Build out our basic SafeString type
|
||||
export function SafeString(string) {
|
||||
this.string = string;
|
||||
|
||||
Reference in New Issue
Block a user