Skip to content

Commit 07c3425

Browse files
committed
chore(patches/log-promise-rejections): do not implicitly return
1 parent f4c5ea1 commit 07c3425

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/patches/log-promise-rejections.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ const ErrorTypeWhitelist = [ReferenceError, TypeError, RangeError]
1212
Promise._m = (promise, err) => {
1313
if (err)
1414
setTimeout(
15-
() =>
15+
() => {
1616
// (if promise._h is 0)
17-
!promise._h &&
18-
nativeLoggingHook(
19-
`\u001b[33mUnhandled promise rejection: ${getErrorStack(err)}\u001b[0m`,
20-
2,
21-
),
17+
if (!promise._h)
18+
nativeLoggingHook(
19+
`\u001b[33mUnhandled promise rejection: ${getErrorStack(err)}\u001b[0m`,
20+
2,
21+
)
22+
},
2223
// The time is completely arbitary. I've picked what Hermes chose.
2324
ErrorTypeWhitelist.some(it => err instanceof it) ? 0 : 2000,
2425
)

0 commit comments

Comments
 (0)