mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-14 16:08:02 -05:00
Simplify native_fn
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user