Remove unnecessary `UnwindSafe` requirement for N-API version of public `try_catch` API.
@@ -226,7 +226,14 @@ pub trait Context<'a>: ContextInternal<'a> {
result
}
- #[cfg(feature = "try-catch-api")]
+ #[cfg(all(feature = "try-catch-api", feature = "napi-runtime"))]
+ fn try_catch<'b: 'a, F>(&mut self, f: F) -> Result<Handle<'a, JsValue>, Handle<'a, JsValue>>
+ where F: FnOnce(&mut Self) -> JsResult<'b, JsValue>
+ {
+ self.try_catch_internal(f)
+ }
+
+ #[cfg(all(feature = "try-catch-api", feature = "legacy-runtime"))]
fn try_catch<'b: 'a, F>(&mut self, f: F) -> Result<Handle<'a, JsValue>, Handle<'a, JsValue>>
where F: UnwindSafe + FnOnce(&mut Self) -> JsResult<'b, JsValue>
{
