chore(patches/log-promise-rejections): do not implicitly return
This commit is contained in:
parent
f4c5ea15a2
commit
07c3425693
1 changed files with 7 additions and 6 deletions
|
|
@ -12,13 +12,14 @@ const ErrorTypeWhitelist = [ReferenceError, TypeError, RangeError]
|
|||
Promise._m = (promise, err) => {
|
||||
if (err)
|
||||
setTimeout(
|
||||
() =>
|
||||
() => {
|
||||
// (if promise._h is 0)
|
||||
!promise._h &&
|
||||
nativeLoggingHook(
|
||||
`\u001b[33mUnhandled promise rejection: ${getErrorStack(err)}\u001b[0m`,
|
||||
2,
|
||||
),
|
||||
if (!promise._h)
|
||||
nativeLoggingHook(
|
||||
`\u001b[33mUnhandled promise rejection: ${getErrorStack(err)}\u001b[0m`,
|
||||
2,
|
||||
)
|
||||
},
|
||||
// The time is completely arbitary. I've picked what Hermes chose.
|
||||
ErrorTypeWhitelist.some(it => err instanceof it) ? 0 : 2000,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue