nanvm_demos/gen.samples/
values.rs1use nanvm_lib::vm::unstable::{bigint_any, 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 Ok([(string_key("default"), A::static_function(|_self, _args| {
10 let _b362: Any<A> = _args.rest(0).to_any();
11 Ok([(Any::dot(_b362.clone(), f64_any(0x0000000000000000)).end())?, string_any("s"), true.to_any(), Nullish::Null.to_any(), [(Any::dot(_b362.clone(), f64_any(0x0000000000000000)).end())?].to_array().to_any(), (<Any<A> as core::ops::Neg>::neg((Any::dot(_b362.clone(), f64_any(0x0000000000000000)).end())?))?, (Any::typeof_(bigint_any(1)))?].to_array().to_any())
12 }, 0, Array::default(), Some("(...$0)=>[$0[0],\"s\",true,null,[$0[0]],-$0[0],typeof 1n]")).to_any())].to_object().to_any())
13}