fix(napi): freeze and seal should be methods of JsObject
This commit is contained in:
parent
4aa56a148c
commit
e8cfa0b467
1 changed files with 10 additions and 10 deletions
|
@ -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) })
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue