tra-analysis/website/functions/node_modules/capture-stack-trace/index.js

19 lines
330 B
JavaScript
Raw Normal View History

2019-01-06 19:14:45 +00:00
'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;
}
});
};