From 07c3425693e390c60efeb4ffa3d8db52f8abd79c Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Fri, 11 Jul 2025 15:20:48 +0700 Subject: [PATCH] chore(patches/log-promise-rejections): do not implicitly return --- src/patches/log-promise-rejections.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/patches/log-promise-rejections.ts b/src/patches/log-promise-rejections.ts index 3dc7301..073260b 100644 --- a/src/patches/log-promise-rejections.ts +++ b/src/patches/log-promise-rejections.ts @@ -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, )