File tree 1 file changed +3
-7
lines changed
Sources/JavaScriptKit/FundamentalObjects
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -167,19 +167,15 @@ private func makeAsyncClosure(
167
167
struct Context : @unchecked Sendable {
168
168
let resolver : ( JSPromise . Result ) -> Void
169
169
let arguments : [ JSValue ]
170
- let body : ( sending [ JSValue ] ) async throws -> JSValue
170
+ let body : ( sending [ JSValue ] ) async throws ( JSException ) -> JSValue
171
171
}
172
172
let context = Context ( resolver: resolver, arguments: arguments, body: body)
173
173
Task {
174
- do {
174
+ do throws ( JSException ) {
175
175
let result = try await context. body ( context. arguments)
176
176
context. resolver ( . success( result) )
177
177
} 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) )
183
179
}
184
180
}
185
181
} . jsValue ( )
You can’t perform that action at this time.
0 commit comments