From e587c527f8407d44dfd3e0fcdd28fa62c9c112d9 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Sat, 14 Jun 2025 22:06:12 +0700 Subject: [PATCH] fix(patches/log-promise-rejections): use falsy check instead of strict equal --- src/patches/log-promise-rejections.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/patches/log-promise-rejections.ts b/src/patches/log-promise-rejections.ts index 31a8b51..3dc7301 100644 --- a/src/patches/log-promise-rejections.ts +++ b/src/patches/log-promise-rejections.ts @@ -13,12 +13,13 @@ Promise._m = (promise, err) => { if (err) setTimeout( () => - promise._h === 0 && + // (if promise._h is 0) + !promise._h && nativeLoggingHook( `\u001b[33mUnhandled promise rejection: ${getErrorStack(err)}\u001b[0m`, 2, ), - ErrorTypeWhitelist.some(it => err instanceof it) ? 0 : 2000, // The time is completely arbitary. I've picked what Hermes chose. + ErrorTypeWhitelist.some(it => err instanceof it) ? 0 : 2000, ) }