nanvm_demos/gen.samples/
entries.rs1use nanvm_lib::vm::unstable::{f64_any, string_any, 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 let _b0: Any<A> = A::static_function(|_self, _args| Any::entry(_args.argument(0), _args.argument(1)), 2, Array::default(), Some("($0,$1)=>{const $2=Object.getOwnPropertyDescriptor($0,$1);return $2?.enumerable?$2.value:undefined;}")).to_any();
10 let _b1: Any<A> = [(string_key("n"), string_any("newline")), (string_key("t"), string_any("tab"))].to_object().to_any();
11 Ok([(string_key("default"), A::static_function(|_self, _args| {
12 let _b468: Any<A> = _args.rest(0).to_any();
13 Any::call(A::frame(_self)[0].clone(), [A::frame(_self)[1].clone(), (Any::dot([string_any("n"), string_any("x")].to_array().to_any(), (Any::number((Any::dot(_b468.clone(), f64_any(0x0000000000000000)).end())?))?).end())?].to_array().to_any())
14 }, 0, [_b0.clone(), _b1.clone()].to_array(), Some("(...$2)=>$0($1,[\"n\",\"x\"][Number($2[0])])")).to_any())].to_object().to_any())
15}