nanvm_demos/gen.samples/
constants.rs1use nanvm_lib::vm::unstable::{f64_any, strict_eq, 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> = {
11 let _b0: Any<A> = [(string_key("port"), f64_any(0x40bf900000000000)), (string_key("host"), string_any("localhost"))].to_object().to_any();
12 [(string_key("dev"), _b0.clone()), (string_key("prod"), _b0.clone())].to_object().to_any()
13 };
14 A::static_function(|_self, _args| {
15 let _b704: Any<A> = _args.rest(0).to_any();
16 Ok([(strict_eq((Any::dot(A::frame(_self)[0].clone(), string_any("dev")).end())?, (Any::dot(A::frame(_self)[0].clone(), string_any("prod")).end())?))?, ((Any::dot((Any::dot(A::frame(_self)[0].clone(), string_any("prod")).end())?, string_any("port")).end())? + (Any::dot(_b704.clone(), f64_any(0x0000000000000000)).end())?)?, (Any::dot((Any::dot(A::frame(_self)[0].clone(), string_any("dev")).end())?, string_any("host")).end())?].to_array().to_any())
17 }, 0, [_b1.clone()].to_array(), Some("(...$1)=>[$0.dev===$0.prod,$0.prod.port+$1[0],$0.dev.host]")).to_any()
18 })].to_object().to_any())
19}