1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#![no_std]
use js::*;

pub fn random() -> f64 {
    lazy_static::lazy_static! {
        static ref FN: JSFunction= {
        register_function(
            "function(){
                    return Math.random();
                }",
        )
    };};
    FN.invoke_0()
}