Skip to main content

nanvm_demos/gen.samples/
variables.rs

1// @generated by `fjs compile`. Do not edit: recompile the source module instead.
2
3use nanvm_lib::vm::unstable::{f64_any, spread_array, spread_item, string_key};
4use nanvm_lib::vm::{Any, Array, 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 _b768: Any<A> = _args.rest(0).to_any();
11        let _b1: Any<A> = (spread_array([spread_item([f64_any(0x0000000000000000), f64_any(0x0000000000000000)].to_array().to_any())?]))?;
12        let _b2: Any<A> = (Any::dot(_b1.clone(), f64_any(0x3ff0000000000000)).end())?;
13        let _b3: Any<A> = (Any::dot(_b1.clone(), f64_any(0x0000000000000000)).end())?;
14        let _b5: Any<A> = (Any::dot(_b768.clone(), f64_any(0x0000000000000000)).end())?;
15        let _b6: Any<A> = (_b3.clone() + _b5.clone())?;
16        let _b7: Any<A> = (_b2.clone() + f64_any(0x3ff0000000000000))?;
17        if Any::<A>::to_boolean((Any::lt(_b5.clone(), f64_any(0x0000000000000000)))?) { Ok([(<Any<A> as core::ops::Neg>::neg(_b6.clone()))?, _b7.clone()].to_array().to_any()) } else { Ok([_b6.clone(), _b7.clone(), (_b5.clone() * f64_any(0x4000000000000000))?].to_array().to_any()) }
18    }, 0, Array::default(), Some("(...$0)=>{const $1=[...[0,0]];const $2=$1[1];const $3=$1[0];const $4=$0[0];const $5=$3+$4;const $6=$2+1;return $4<0?[-$5,$6]:[$5,$6,$4*2];}")).to_any())].to_object().to_any())
19}