You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, making a call from Swift to JS that results in an error being thrown on the JS side will leave the code in a strange state. I’m not sure if wasm is able to recover from this. Maybe there could be an additional parameter passed to the JS function that allows it to send back a JSObjectRef pointing to a thrown error (kind of like Objective-C!).
Since we don’t have type info (which could be partially alleviated by #21) we have to assume that every property access and function call potentially throws. Not sure what the proper balance is here.
We’d also need a way to bridge errors over to the Swift side. Perhaps this could be somewhat type-safe, with distinct subclasses for common/host-provided errors and a generic JSError class for everything else.
It would also be good to make JSClosures able to throw, then wrap those errors into a SwiftError on the JS side.
The text was updated successfully, but these errors were encountered:
Currently, making a call from Swift to JS that results in an error being thrown on the JS side will leave the code in a strange state. I’m not sure if wasm is able to recover from this. Maybe there could be an additional parameter passed to the JS function that allows it to send back a
JSObjectRef
pointing to a thrown error (kind of like Objective-C!).Since we don’t have type info (which could be partially alleviated by #21) we have to assume that every property access and function call potentially
throws
. Not sure what the proper balance is here.We’d also need a way to bridge errors over to the Swift side. Perhaps this could be somewhat type-safe, with distinct subclasses for common/host-provided errors and a generic
JSError
class for everything else.It would also be good to make
JSClosures
able to throw, then wrap those errors into aSwiftError
on the JS side.The text was updated successfully, but these errors were encountered: