Remove all items from the list
(
mc: &'gc Mutation<'gc>,
receiver: Value<'gc>,
_args: Vec<Value<'gc>>,
)
| 175 | |
| 176 | // Remove all items from the list |
| 177 | fn clear<'gc>( |
| 178 | mc: &'gc Mutation<'gc>, |
| 179 | receiver: Value<'gc>, |
| 180 | _args: Vec<Value<'gc>>, |
| 181 | ) -> Result<Value<'gc>, VmError> { |
| 182 | let list = receiver.as_array()?; |
| 183 | |
| 184 | let mut list_mut = list.borrow_mut(mc); |
| 185 | list_mut.data.clear(); |
| 186 | |
| 187 | Ok(receiver) |
| 188 | } |
| 189 | |
| 190 | // Return zero-based index of the first item with value equal to x |
| 191 | fn index<'gc>( |
nothing calls this directly
no test coverage detected