diff --git a/src/obj/function.rs b/src/obj/function.rs index 556a4ec..c36dcb2 100644 --- a/src/obj/function.rs +++ b/src/obj/function.rs @@ -223,13 +223,23 @@ impl Obj for UserFunctionInst { // MethodInst //////////////////////////////////////////////////////////////////////////////// -#[derive(Debug, Trace)] +#[derive(Trace)] pub struct MethodInst { base: BaseObjInst, self_binding: ObjP, function: ObjP, } +impl Debug for MethodInst { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("MethodInst") + .field("base", &self.base) + .field("self_binding", &format!("{}", self.self_binding.borrow())) + .field("function", &self.function) + .finish() + } +} + impl MethodInst { pub fn new(self_binding: ObjP, function: ObjP) -> Self { Self {