From 39eaada97095e22f4b3a419a3f4347ac569c69d9 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sat, 28 Sep 2024 07:25:31 -0700 Subject: [PATCH] soft-deprecate JsFunction::{call, construct, call_with, construct_with} --- crates/neon/src/types_impl/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/neon/src/types_impl/mod.rs b/crates/neon/src/types_impl/mod.rs index e9c254572..79879230f 100644 --- a/crates/neon/src/types_impl/mod.rs +++ b/crates/neon/src/types_impl/mod.rs @@ -1136,6 +1136,7 @@ impl JsFunction { /// Calls this function. /// /// **See also:** [`JsFunction::call_with`]. + #[deprecated(since = "TBD", note = "use `JsFunction::bind` instead")] pub fn call<'a, 'b, C: Context<'a>, T, AS>( &self, cx: &mut C, @@ -1152,6 +1153,7 @@ impl JsFunction { /// Calls this function for side effect, discarding its result. /// /// **See also:** [`JsFunction::call_with`]. + #[deprecated(since = "TBD", note = "use `JsFunction::bind` instead")] pub fn exec<'a, 'b, C: Context<'a>, T, AS>( &self, cx: &mut C, @@ -1169,6 +1171,7 @@ impl JsFunction { /// Calls this function as a constructor. /// /// **See also:** [`JsFunction::construct_with`]. + #[deprecated(since = "TBD", note = "use `JsFunction::bind` instead")] pub fn construct<'a, 'b, C: Context<'a>, AS>( &self, cx: &mut C, @@ -1199,6 +1202,7 @@ impl JsFunction { impl JsFunction { /// Create a [`CallOptions`](function::CallOptions) for calling this function. + #[deprecated(since = "TBD", note = "use `JsFunction::bind` instead")] pub fn call_with<'a, C: Context<'a>>(&self, _cx: &C) -> CallOptions<'a> { CallOptions { this: None, @@ -1213,6 +1217,7 @@ impl JsFunction { /// Create a [`ConstructOptions`](function::ConstructOptions) for calling this function /// as a constructor. + #[deprecated(since = "TBD", note = "use `JsFunction::bind` instead")] pub fn construct_with<'a, C: Context<'a>>(&self, _cx: &C) -> ConstructOptions<'a> { ConstructOptions { // # Safety