diff --git a/napi/src/js_values/value_ref.rs b/napi/src/js_values/value_ref.rs index c130e9d9..4f49957a 100644 --- a/napi/src/js_values/value_ref.rs +++ b/napi/src/js_values/value_ref.rs @@ -32,6 +32,11 @@ impl Ref { }) } + pub fn reference(&mut self, env: &Env) -> Result { + check_status(unsafe { sys::napi_reference_ref(env.0, self.raw_ref, &mut self.count) })?; + Ok(self.count) + } + #[must_use] pub fn unref(mut self, env: Env) -> Result { check_status(unsafe { sys::napi_reference_unref(env.0, self.raw_ref, &mut self.count) })?;