Manually implement Debug for MethodInst
MethodInst's self_binding was causing endless recursion issues, this just skips over it and uses the normal formatting for it Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user