From c3ec45657ebf9e8393d0deadf583912f1228bca6 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Wed, 9 Apr 2025 18:22:19 +0900 Subject: [PATCH] Export `UnsafeEventLoopYield` error type Some apps wrap instance.exports and monitor exceptions thrown during execution of Wasm program but `UnsafeEventLoopYield` is not something they want to report, so they need to be able to filter them out. However, they cannot use `UnsafeEventLoopYield` type name because some bundlers can rename it. We should export it to allow them not to depend on the constructor name --- Runtime/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/src/index.ts b/Runtime/src/index.ts index ee12e5be..b70bed3a 100644 --- a/Runtime/src/index.ts +++ b/Runtime/src/index.ts @@ -749,4 +749,4 @@ export class SwiftRuntime { /// This error is thrown to unwind the call stack of the Swift program and return the control to /// the JavaScript side. Otherwise, the `swift_task_asyncMainDrainQueue` ends up with `abort()` /// because the event loop expects `exit()` call before the end of the event loop. -class UnsafeEventLoopYield extends Error {} +export class UnsafeEventLoopYield extends Error {}