Skip to content

Commit

Permalink
soft-deprecate JsFunction::{call, construct, call_with, construct_with}
Browse files Browse the repository at this point in the history
  • Loading branch information
dherman committed Sep 28, 2024
1 parent b5a76b8 commit 39eaada
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/neon/src/types_impl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 39eaada

Please sign in to comment.