(reason, cb)
| 382 | } |
| 383 | |
| 384 | const callbackifyOnRejected = (reason, cb) => { |
| 385 | // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). |
| 386 | // Because `null` is a special error value in callbacks which means "no error |
| 387 | // occurred", we error-wrap so the callback consumer can distinguish between |
| 388 | // "the promise rejected with null" or "the promise fulfilled with undefined". |
| 389 | if (!reason) { |
| 390 | reason = new ERR_FALSY_VALUE_REJECTION.HideStackFramesError(reason); |
| 391 | ErrorCaptureStackTrace(reason, callbackifyOnRejected); |
| 392 | } |
| 393 | return cb(reason); |
| 394 | }; |
| 395 | |
| 396 | /** |
| 397 | * Converts a Promise-returning function to callback style |
nothing calls this directly
no test coverage detected
searching dependent graphs…