Skip to content

Commit

Permalink
Remove unnecessary UnwindSafe requirement for N-API version of publ…
Browse files Browse the repository at this point in the history
…ic `try_catch` API.
  • Loading branch information
dherman committed Jul 14, 2020
1 parent ef349bb commit 35a8858
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
{
Expand Down

0 comments on commit 35a8858

Please sign in to comment.