(
_state: &mut State<'gc>,
args: Vec<Value<'gc>>,
)
| 61 | } |
| 62 | |
| 63 | fn random_float<'gc>( |
| 64 | _state: &mut State<'gc>, |
| 65 | args: Vec<Value<'gc>>, |
| 66 | ) -> Result<Value<'gc>, VmError> { |
| 67 | if !args.is_empty() { |
| 68 | return Err(VmError::RuntimeError("random() takes no arguments".into())); |
| 69 | } |
| 70 | |
| 71 | RNG.with(|rng| { |
| 72 | let val: f64 = rng.borrow_mut().random(); |
| 73 | Ok(Value::Number(val)) |
| 74 | }) |
| 75 | } |
| 76 | |
| 77 | fn random_int<'gc>(_state: &mut State<'gc>, args: Vec<Value<'gc>>) -> Result<Value<'gc>, VmError> { |
| 78 | if args.len() != 2 { |
nothing calls this directly
no test coverage detected