|
243 | 243 | if (!isPrepared) { |
244 | 244 | const prep = Error.prepareStackTrace || prepareStackTrace; |
245 | 245 |
|
246 | | - // Prep can be re-entrant, of sorts, with regards to setting err.stack vs returning what err.stack should be |
| 246 | + // Prep can be re-entrant, of sorts, with regards to setting err.stack |
| 247 | + // vs returning what err.stack should be. |
247 | 248 | // We are trying to emulate the following behavior: |
248 | | - // Error.prepareStackTrace = function (err, frames) { err.stack = 1 } -> err.stack should be 1 |
249 | | - // Error.prepareStackTrace = function (err, frames) { console.log("Called prepare") } -> err.stack should be undefined |
250 | | - // Error.prepareStackTrace = function (err, frames) { return 2 } -> err.stack should be 2 |
251 | | - // Error.prepareStackTrace = function (err, frames) { err.stack = 1; return 2; } -> err.stack should be *1* |
| 249 | + // * Error.prepareStackTrace = function (err, frames) |
| 250 | + // { err.stack = 1 } -> err.stack should be 1 |
| 251 | + // * Error.prepareStackTrace = function (err, frames) |
| 252 | + // { console.log("Called prepare") } -> err.stack should be undefined |
| 253 | + // * Error.prepareStackTrace = function (err, frames) |
| 254 | + // { return 2 } -> err.stack should be 2 |
| 255 | + // * Error.prepareStackTrace = function (err, frames) |
| 256 | + // { err.stack = 1; return 2; } -> err.stack should be *1* |
252 | 257 | const preparedStack = prep(err, ensureStackTrace()); |
253 | 258 | if (!isPrepared) { |
254 | 259 | stackSetter(preparedStack); |
|
0 commit comments