Simplify native_fn

This commit is contained in:
Andrew Morris
2023-05-26 16:13:23 +10:00
parent d214e27dc8
commit 1613734325
15 changed files with 1436 additions and 1648 deletions

View File

@@ -37,6 +37,12 @@ pub struct NativeFunction {
pub fn_: fn(this: ThisWrapper, params: Vec<Val>) -> Result<Val, Val>,
}
pub const fn native_fn(
fn_: fn(this: ThisWrapper, params: Vec<Val>) -> Result<Val, Val>,
) -> NativeFunction {
NativeFunction { fn_ }
}
impl ValTrait for NativeFunction {
fn typeof_(&self) -> VsType {
VsType::Function