Skip to main content

nanvm_demos/gen.samples/
static_functions.rs

1// @generated by `fjs compile`. Do not edit: recompile the source module instead.
2
3use nanvm_lib::vm::unstable::{f64_any, static_read, 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 _b0: Any<A> = (static_read(&runtime, "Object.is"))?;
10    let _b1: Any<A> = (static_read(&runtime, "Number.isInteger"))?;
11    Ok([(string_key("default"), A::static_function(|_self, _args| {
12        let _b972: Any<A> = _args.rest(0).to_any();
13        let _b9: Any<A> = (static_read(&A::frame(_self)[2], "Number.isFinite"))?;
14        let _b13: Any<A> = (static_read(&A::frame(_self)[2], "Object.entries"))?;
15        Ok([(Any::call(A::frame(_self)[0].clone(), [(Any::dot(_b972.clone(), f64_any(0x0000000000000000)).end())?, f64_any(0x8000000000000000)].to_array().to_any()))?, (Any::call(A::frame(_self)[1].clone(), [(Any::dot(_b972.clone(), f64_any(0x0000000000000000)).end())?].to_array().to_any()))?, (Any::call(_b9.clone(), [(f64_any(0x3ff0000000000000) / (Any::dot(_b972.clone(), f64_any(0x0000000000000000)).end())?)?].to_array().to_any()))?, (Any::call(_b13.clone(), [[(string_key("b"), (Any::dot(_b972.clone(), f64_any(0x0000000000000000)).end())?), (string_key("0"), f64_any(0x4000000000000000))].to_object().to_any()].to_array().to_any()))?].to_array().to_any())
16    }, 0, [_b0.clone(), _b1.clone(), runtime.clone()].to_array(), Some("(...$2)=>{const $3=Number.isFinite;const $4=Object.entries;return [$0($2[0],-0),$1($2[0]),$3(1/$2[0]),$4({\"b\":$2[0],\"0\":2})];}")).to_any())].to_object().to_any())
17}