nanvm_demos/gen.samples/
property_access.rs1use nanvm_lib::vm::unstable::{f64_any, 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"), {
10 let _b1: Any<A> = [(string_key("ports"), [f64_any(0x4054000000000000), f64_any(0x407bb00000000000)].to_array().to_any())].to_object().to_any();
11 A::static_function(|_self, _args| {
12 let _b524: Any<A> = _args.rest(0).to_any();
13 Ok([(Any::dot((Any::dot(A::frame(_self)[0].clone(), string_any("ports")).end())?, (Any::number((Any::dot(_b524.clone(), f64_any(0x0000000000000000)).end())?))?).end())?, (Any::dot((Any::dot(A::frame(_self)[0].clone(), string_any("ports")).end())?, string_any("length")).end())?].to_array().to_any())
14 }, 0, [_b1.clone()].to_array(), Some("(...$1)=>[$0.ports[Number($1[0])],$0.ports.length]")).to_any()
15 })].to_object().to_any())
16}