(self)
| 161 | } |
| 162 | |
| 163 | pub fn as_number(self) -> Result<f64, VmError> { |
| 164 | match self { |
| 165 | Value::Number(value) => Ok(value), |
| 166 | a => Err(VmError::RuntimeError(format!( |
| 167 | "cannot convert to number: {}", |
| 168 | a |
| 169 | ))), |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | pub fn as_boolean(&self) -> bool { |
| 174 | match self { |
no test coverage detected