benji.monster/node_modules/capture-stack-trace/index.js
2020-01-03 21:48:09 +01:00

18 lines
330 B
JavaScript

'use strict';
module.exports = Error.captureStackTrace || function (error) {
var container = new Error();
Object.defineProperty(error, 'stack', {
configurable: true,
get: function getStack() {
var stack = container.stack;
Object.defineProperty(this, 'stack', {
value: stack
});
return stack;
}
});
};