`del obj.attr` opcode: pop the object, remove the named attribute in place. */
(&mut self, op: u16, chunk: &crate::modules::parser::SSAChunk)
| 114 | |
| 115 | /* `del obj.attr` opcode: pop the object, remove the named attribute in place. */ |
| 116 | pub fn exec_del_attr(&mut self, op: u16, chunk: &crate::modules::parser::SSAChunk) -> Result<(), VmErr> { |
| 117 | let obj = self.pop()?; |
| 118 | let name = chunk.names.get(op as usize).ok_or(cold_runtime("DelAttr: bad name index"))?.clone(); |
| 119 | self.delete_attr_named(obj, &name) |
| 120 | } |
| 121 | |
| 122 | /* Shared attribute removal for `delattr()` and `del obj.attr`; AttributeError when absent. */ |
| 123 | fn delete_attr_named(&mut self, obj: Val, name: &str) -> Result<(), VmErr> { |
no test coverage detected