mirror of
https://github.com/nodejs/node.git
synced 2025-05-13 13:01:31 +00:00

PR-URL: https://github.com/nodejs/node/pull/4958 Reviewed-By: Myles Borins <mborins@us.ibm.com> Reviewed-By: Kat Marchán <kzm@sykosomatic.org> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
17 lines
349 B
JavaScript
17 lines
349 B
JavaScript
'use strict'
|
|
var inherits = require('inherits')
|
|
|
|
module.exports = SaveStack
|
|
|
|
function SaveStack (fn) {
|
|
Error.call(this)
|
|
Error.captureStackTrace(this, fn || SaveStack)
|
|
}
|
|
inherits(SaveStack, Error)
|
|
|
|
SaveStack.prototype.completeWith = function (er) {
|
|
this['__' + 'proto' + '__'] = er
|
|
this.stack = this.stack + '\n\n' + er.stack
|
|
return this
|
|
}
|