You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
330 B
JavaScript
19 lines
330 B
JavaScript
6 years ago
|
'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;
|
||
|
}
|
||
|
});
|
||
|
};
|