From e8cfa0b467d71a560c868cdf27f356f77d7cbbb1 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sun, 21 Nov 2021 23:11:14 +0800 Subject: [PATCH] fix(napi): freeze and seal should be methods of JsObject --- crates/napi/src/js_values/mod.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/napi/src/js_values/mod.rs b/crates/napi/src/js_values/mod.rs index ca1ff8c4..9ff4a19d 100644 --- a/crates/napi/src/js_values/mod.rs +++ b/crates/napi/src/js_values/mod.rs @@ -254,16 +254,6 @@ macro_rules! impl_js_value_methods { })?; Ok(result) } - - #[cfg(feature = "napi8")] - pub fn freeze(&mut self) -> Result<()> { - check_status!(unsafe { sys::napi_object_freeze(self.0.env, self.0.value) }) - } - - #[cfg(feature = "napi8")] - pub fn seal(&mut self) -> Result<()> { - check_status!(unsafe { sys::napi_object_seal(self.0.env, self.0.value) }) - } } }; } @@ -572,6 +562,16 @@ macro_rules! impl_object_methods { })?; Ok(length) } + + #[cfg(feature = "napi8")] + pub fn freeze(&mut self) -> Result<()> { + check_status!(unsafe { sys::napi_object_freeze(self.0.env, self.0.value) }) + } + + #[cfg(feature = "napi8")] + pub fn seal(&mut self) -> Result<()> { + check_status!(unsafe { sys::napi_object_seal(self.0.env, self.0.value) }) + } } }; }