Skip to main content

nanvm_demos/gen.samples/
objects.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_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    Ok([(string_key("default"), A::static_function(|_self, _args| {
10        let _b414: Any<A> = _args.rest(0).to_any();
11        let _b0: Any<A> = (static_read(&A::frame(_self)[0], "Object.entries"))?;
12        let _b4: Any<A> = [(string_key("a"), string_any("hello")), (string_key("b"), (Any::dot(_b414.clone(), f64_any(0x0000000000000000)).end())?), (string_key("c"), [f64_any(0x3ff0000000000000), f64_any(0x4000000000000000)].to_array().to_any())].to_object().to_any();
13        (Any::dot((Any::call(_b0.clone(), [_b4.clone()].to_array().to_any()))?, string_any("length")).end())? + (Any::dot(_b4.clone(), string_any("b")).end())?
14    }, 0, [runtime.clone()].to_array(), Some("(...$0)=>{const $1=Object.entries;const $2={\"a\":\"hello\",\"b\":$0[0],\"c\":[1,2]};return $1($2).length+$2.b;}")).to_any())].to_object().to_any())
15}