(_state: &mut State<'gc>, args: Vec<Value<'gc>>)
| 170 | } |
| 171 | |
| 172 | fn all<'gc>(_state: &mut State<'gc>, args: Vec<Value<'gc>>) -> Result<Value<'gc>, VmError> { |
| 173 | if args.len() != 1 { |
| 174 | return Err(VmError::RuntimeError( |
| 175 | "all() takes exactly one argument.".into(), |
| 176 | )); |
| 177 | } |
| 178 | |
| 179 | match &args[0] { |
| 180 | Value::List(arr) => { |
| 181 | let arr = arr.borrow(); |
| 182 | Ok(Value::Boolean(arr.data.iter().all(|x| x.is_true()))) |
| 183 | } |
| 184 | _ => Err(VmError::RuntimeError( |
| 185 | "all() argument must be an array.".into(), |
| 186 | )), |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | fn min<'gc>(_state: &mut State<'gc>, args: Vec<Value<'gc>>) -> Result<Value<'gc>, VmError> { |
| 191 | if args.is_empty() { |
nothing calls this directly
no test coverage detected