Skip to main content

nanvm_harness/gen.fixtures/
guarded_calls.rs

1// @generated by `fjs compile`. Do not edit: recompile the source module instead.
2
3use nanvm_lib::vm::unstable::{f64_any, strict_eq, string_any, string_key};
4use nanvm_lib::vm::{Any, IStaticFunction, Nullish, Object, 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 _b0: Any<A> = [f64_any(0x4024000000000000), f64_any(0x4034000000000000)].to_array().to_any();
11        [(Any::option_dot(_b0.clone(), || Ok(string_any("at"))).call(&runtime, || Ok([f64_any(0x0000000000000000)].to_array().to_any())).end())?, (Any::dot(_b0.clone(), string_any("at")).option_call(&runtime, || Ok([f64_any(0x3ff0000000000000)].to_array().to_any())).end())?, {
12            let _b4: Any<A> = (Any::option_dot(Nullish::Undefined.to_any(), || Ok(string_any("at"))).call(&runtime, || Ok([f64_any(0x0000000000000000)].to_array().to_any())).end())?;
13            if Any::<A>::to_boolean(if Any::<A>::to_boolean((strict_eq(_b4.clone(), Nullish::Null.to_any()))?) { true.to_any() } else { (strict_eq(_b4.clone(), Nullish::Undefined.to_any()))? }) { f64_any(0x0000000000000000) } else { _b4.clone() }
14        }, {
15            let _b13: Any<A> = (Any::option_dot((Any::option_dot(Nullish::Undefined.to_any(), || Ok(string_any("map"))).call(&runtime, || Ok([A::static_function(|_self, _args| { Ok(_args.argument(0)) }, 1, [runtime.clone()].to_array(), Some("($0)=>$0")).to_any()].to_array().to_any())).end())?, || Ok(string_any("at"))).call(&runtime, || Ok([f64_any(0x0000000000000000)].to_array().to_any())).end())?;
16            if Any::<A>::to_boolean(if Any::<A>::to_boolean((strict_eq(_b13.clone(), Nullish::Null.to_any()))?) { true.to_any() } else { (strict_eq(_b13.clone(), Nullish::Undefined.to_any()))? }) { f64_any(0x0000000000000000) } else { _b13.clone() }
17        }, {
18            let _b21: Any<A> = (Any::option_dot((Any::dot(Object::default().to_any(), string_any("s")).end())?, || Ok(string_any("endsWith"))).call(&runtime, || Ok([string_any("x")].to_array().to_any())).end())?;
19            if Any::<A>::to_boolean(if Any::<A>::to_boolean((strict_eq(_b21.clone(), Nullish::Null.to_any()))?) { true.to_any() } else { (strict_eq(_b21.clone(), Nullish::Undefined.to_any()))? }) { f64_any(0x0000000000000000) } else { _b21.clone() }
20        }, (Any::option_dot(string_any("abc"), || Ok(string_any("startsWith"))).call(&runtime, || Ok([string_any("a")].to_array().to_any())).end())?].to_array().to_any()
21    })].to_object().to_any())
22}