Comparing version 2.0.1 to 2.0.2
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { var object = _x2, property = _x3, receiver = _x4; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -17,3 +17,5 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
function ExtendableError(message) { | ||
function ExtendableError() { | ||
var message = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0]; | ||
_classCallCheck(this, ExtendableError); | ||
@@ -23,2 +25,8 @@ | ||
// extending Error is weird and does not propagate `message` | ||
Object.defineProperty(this, 'message', { | ||
enumerable: false, | ||
value: message | ||
}); | ||
Object.defineProperty(this, 'name', { | ||
@@ -31,8 +39,9 @@ enumerable: false, | ||
Error.captureStackTrace(this, this.constructor); | ||
} else { | ||
Object.defineProperty(this, 'stack', { | ||
enumerable: false, | ||
value: new Error(message).stack | ||
}); | ||
return; | ||
} | ||
Object.defineProperty(this, 'stack', { | ||
enumerable: false, | ||
value: new Error(message).stack | ||
}); | ||
} | ||
@@ -39,0 +48,0 @@ |
{ | ||
"name": "es6-error", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Easily-extendable error for use with ES6 classes", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"test": "mocha --compilers js:babel/register" | ||
"test": "mocha --compilers js:babel/register", | ||
"prepublish": "npm test && make dist" | ||
}, | ||
@@ -9,0 +10,0 @@ "repository": { |
@@ -18,8 +18,9 @@ class ExtendableError extends Error { | ||
Error.captureStackTrace(this, this.constructor); | ||
} else { | ||
Object.defineProperty(this, 'stack', { | ||
enumerable : false, | ||
value : (new Error(message)).stack, | ||
}); | ||
return; | ||
} | ||
Object.defineProperty(this, 'stack', { | ||
enumerable : false, | ||
value : (new Error(message)).stack, | ||
}); | ||
} | ||
@@ -26,0 +27,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8167
10
110