Skip to main content

nanvm_harness/gen.fixtures/
callbacks.rs

1// @generated by `fjs compile`. Do not edit: recompile the source module instead.
2
3use nanvm_lib::vm::unstable::{f64_any, strict_eq, 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    let _b109: Any<A> = A::static_function(|_self, _args| {
10        let _b15824: Any<A> = _args.rest(0).to_any();
11        Ok([(Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("map")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| { _args.argument(0) * (Any::dot(A::frame(_self)[0].clone(), f64_any(0x0000000000000000)).end())? }, 1, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1)=>$1*$0[0]")).to_any()].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("map")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| { _args.argument(0) + (_args.argument(1) * (Any::dot(A::frame(_self)[0].clone(), f64_any(0x0000000000000000)).end())?)? }, 2, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1,$2)=>$1+$2*$0[0]")).to_any()].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].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())? / f64_any(0x4024000000000000))?) }, 1, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1)=>$1>$0[0]/10")).to_any()].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("reduce")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| { _args.argument(0) + (_args.argument(1) * (Any::dot(A::frame(_self)[0].clone(), f64_any(0x0000000000000000)).end())?)? }, 2, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1,$2)=>$1+$2*$0[0]")).to_any(), f64_any(0x0000000000000000)].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("reduceRight")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| { _args.argument(0) + (_args.argument(1) * (Any::dot(A::frame(_self)[0].clone(), f64_any(0x0000000000000000)).end())?)? }, 2, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1,$2)=>$1+$2*$0[0]")).to_any(), string_any("")].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("find")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| {
12            let _b47: Any<A> = (Any::lt(_args.argument(0), (Any::dot(A::frame(_self)[0].clone(), f64_any(0x0000000000000000)).end())?))?;
13            if Any::<A>::to_boolean(_b47.clone()) { Any::gt(_args.argument(0), f64_any(0x3ff0000000000000)) } else { Ok(_b47.clone()) }
14        }, 1, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1)=>{const $2=$1<$0[0];return $2?$1>1:$2;}")).to_any()].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("findIndex")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| { strict_eq(_args.argument(0), ((Any::dot(A::frame(_self)[0].clone(), f64_any(0x0000000000000000)).end())? - f64_any(0x4020000000000000))?) }, 1, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1)=>$1===$0[0]-8")).to_any()].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("findLast")).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())? - f64_any(0x4022000000000000))?) }, 1, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1)=>$1>$0[0]-9")).to_any()].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("findLastIndex")).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, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1)=>$1>$0[0]")).to_any()].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("some")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| { strict_eq(_args.argument(0), ((Any::dot(A::frame(_self)[0].clone(), f64_any(0x0000000000000000)).end())? - f64_any(0x4020000000000000))?) }, 1, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1)=>$1===$0[0]-8")).to_any()].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("every")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| { Any::lt(_args.argument(0), (Any::dot(A::frame(_self)[0].clone(), f64_any(0x0000000000000000)).end())?) }, 1, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1)=>$1<$0[0]")).to_any()].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("flatMap")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| { Ok([_args.argument(0), (_args.argument(0) * (Any::dot(A::frame(_self)[0].clone(), f64_any(0x0000000000000000)).end())?)?].to_array().to_any()) }, 1, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1)=>[$1,$1*$0[0]]")).to_any()].to_array().to_any())))?, (Any::dot([f64_any(0x4008000000000000), f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any(), string_any("map")).end_call(&A::frame(_self)[0], || Ok([A::static_function(|_self, _args| { ((Any::dot(_args.argument(2), string_any("length")).end())? + _args.argument(1))? + (Any::dot(A::frame(_self)[0].clone(), f64_any(0x0000000000000000)).end())? }, 3, [_b15824.clone(), A::frame(_self)[0].clone()].to_array(), Some("($1,$2,$3)=>$3.length+$2+$0[0]")).to_any()].to_array().to_any())))?].to_array().to_any())
15    }, 0, [runtime.clone()].to_array(), Some("(...$0)=>[[3,1,2].map(($1)=>$1*$0[0]),[3,1,2].map(($2,$3)=>$2+$3*$0[0]),[3,1,2].filter(($4)=>$4>$0[0]/10),[3,1,2].reduce(($5,$6)=>$5+$6*$0[0],0),[3,1,2].reduceRight(($7,$8)=>$7+$8*$0[0],\"\"),[3,1,2].find(($9)=>{const $10=$9<$0[0];return $10?$9>1:$10;}),[3,1,2].findIndex(($11)=>$11===$0[0]-8),[3,1,2].findLast(($12)=>$12>$0[0]-9),[3,1,2].findLastIndex(($13)=>$13>$0[0]),[3,1,2].some(($14)=>$14===$0[0]-8),[3,1,2].every(($15)=>$15<$0[0]),[3,1,2].flatMap(($16)=>[$16,$16*$0[0]]),[3,1,2].map(($17,$18,$19)=>$19.length+$18+$0[0])]")).to_any();
16    Ok([(string_key("default"), (Any::call(_b109.clone(), [f64_any(0x4024000000000000)].to_array().to_any()))?)].to_object().to_any())
17}