Skip to main content

nanvm_demos/gen.samples/
member_functions.rs

1// @generated by `fjs compile`. Do not edit: recompile the source module instead.
2
3use nanvm_lib::vm::unstable::{f64_any, string_any, string_key};
4use nanvm_lib::vm::{Any, IStaticFunction, ToAny, ToArray, ToObject};
5
6#[rustfmt::skip]
7#[allow(clippy::if_same_then_else)]
8pub fn module<A: IStaticFunction>(runtime: Any<A>) -> Result<Any<A>, Any<A>> {
9    Ok([(string_key("default"), A::static_function(|_self, _args| {
10        let _b642: Any<A> = _args.rest(0).to_any();
11        Any::dot((Any::dot((Any::dot([f64_any(0x3ff0000000000000), f64_any(0x4000000000000000), f64_any(0x4008000000000000), f64_any(0x4010000000000000)].to_array().to_any(), string_any("filter")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| { Any::gt(_args.argument(0), (Any::dot(A::frame(_self)[0].clone(), f64_any(0x0000000000000000)).end())?) }, 1, [_b642.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1)=>$1>$0[0]")).to_any()].to_array().to_any())))?, string_any("map")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| { _args.argument(0) * f64_any(0x4024000000000000) }, 1, [A::frame(_self)[0].clone()].to_array(), Some("($0)=>$0*10")).to_any()].to_array().to_any())))?, string_any("join")).end_call(&A::frame(_self)[0], || Ok([string_any("-")].to_array().to_any()))
12    }, 0, [runtime.clone()].to_array(), Some("(...$0)=>[1,2,3,4].filter(($1)=>$1>$0[0]).map(($2)=>$2*10).join(\"-\")")).to_any())].to_object().to_any())
13}