File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Sources/JavaScriptKit/FundamentalObjects Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -167,19 +167,15 @@ private func makeAsyncClosure(
167167 struct Context : @unchecked Sendable {
168168 let resolver : ( JSPromise . Result ) -> Void
169169 let arguments : [ JSValue ]
170- let body : ( sending [ JSValue ] ) async throws -> JSValue
170+ let body : ( sending [ JSValue ] ) async throws ( JSException ) -> JSValue
171171 }
172172 let context = Context ( resolver: resolver, arguments: arguments, body: body)
173173 Task {
174- do {
174+ do throws ( JSException ) {
175175 let result = try await context. body ( context. arguments)
176176 context. resolver ( . success( result) )
177177 } catch {
178- if let jsError = error as? JSException {
179- context. resolver ( . failure( jsError. thrownValue) )
180- } else {
181- context. resolver ( . failure( JSError ( message: String ( describing: error) ) . jsValue) )
182- }
178+ context. resolver ( . failure( error. thrownValue) )
183179 }
184180 }
185181 } . jsValue ( )
You can’t perform that action at this time.
0 commit comments