(_state: &mut State<'gc>, args: Vec<Value<'gc>>)
| 152 | } |
| 153 | |
| 154 | fn any<'gc>(_state: &mut State<'gc>, args: Vec<Value<'gc>>) -> Result<Value<'gc>, VmError> { |
| 155 | if args.len() != 1 { |
| 156 | return Err(VmError::RuntimeError( |
| 157 | "any() takes exactly one argument.".into(), |
| 158 | )); |
| 159 | } |
| 160 | |
| 161 | match &args[0] { |
| 162 | Value::List(arr) => { |
| 163 | let arr = &arr.borrow().data; |
| 164 | Ok(Value::Boolean(arr.iter().any(|x| x.is_true()))) |
| 165 | } |
| 166 | _ => Err(VmError::RuntimeError( |
| 167 | "any() argument must be an array.".into(), |
| 168 | )), |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | fn all<'gc>(_state: &mut State<'gc>, args: Vec<Value<'gc>>) -> Result<Value<'gc>, VmError> { |
| 173 | if args.len() != 1 { |
nothing calls this directly
no test coverage detected