Skip to main content

nanvm_demos/gen.samples/
comma.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, Array, IStaticFunction, Nullish, 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 _b6: Any<A> = A::static_function(|_self, _args| {
10        let _b327: Any<A> = _args.rest(0).to_any();
11        if Any::<A>::to_boolean((Any::dot(_b327.clone(), f64_any(0x0000000000000000)).end())?) { Ok(Nullish::Undefined.to_any()) } else { Err((Any::dot(_b327.clone(), f64_any(0x3ff0000000000000)).end())?) }
12    }, 0, Array::default(), Some("(...$0)=>$0[0]?undefined:(()=>{throw $0[1];})()")).to_any();
13    Ok([(string_key("default"), A::static_function(|_self, _args| {
14        let _b768: Any<A> = _args.rest(0).to_any();
15        let _b850: Any<A> = (Any::call(A::frame(_self)[0].clone(), [(Any::ge((Any::dot(_b768.clone(), f64_any(0x0000000000000000)).end())?, f64_any(0x0000000000000000)))?, string_any("negative")].to_array().to_any()))?;
16        (Any::dot(_b768.clone(), f64_any(0x0000000000000000)).end())? + f64_any(0x4000000000000000)
17    }, 0, [_b6.clone()].to_array(), Some("(...$1)=>{const $2=$0($1[0]>=0,\"negative\");return $1[0]+2;}")).to_any())].to_object().to_any())
18}