(&mut self, op: u16)
| 483 | } |
| 484 | |
| 485 | pub fn call_all(&mut self, op: u16) -> Result<(), VmErr> { |
| 486 | if op != 1 { return Err(cold_type("all() takes exactly 1 argument")); } |
| 487 | let o = self.pop()?; |
| 488 | let mut cur = self.iter_cursor(o)?; |
| 489 | while let Some(v) = cur.next(&mut self.heap)? { |
| 490 | self.charge_step()?; // native iteration over a huge range must charge the op-budget |
| 491 | if !self.truthy(v) { |
| 492 | self.push(Val::bool(false)); |
| 493 | return Ok(()); |
| 494 | } |
| 495 | } |
| 496 | self.push(Val::bool(true)); |
| 497 | Ok(()) |
| 498 | } |
| 499 | |
| 500 | pub fn call_any(&mut self, op: u16) -> Result<(), VmErr> { |
| 501 | if op != 1 { return Err(cold_type("any() takes exactly 1 argument")); } |
no test coverage detected