eth/tracers/js: consistent name for method receivers #29375 (#1461)

Co-authored-by: Brandon Liu <lzqcn2000@126.com>
This commit is contained in:
Daniel Liu 2025-09-13 10:16:43 +08:00 committed by GitHub
parent bcf007335a
commit bb458d0eed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -676,11 +676,11 @@ func (mo *memoryObj) Length() int {
return len(mo.memory) return len(mo.memory)
} }
func (m *memoryObj) setupObject() *goja.Object { func (mo *memoryObj) setupObject() *goja.Object {
o := m.vm.NewObject() o := mo.vm.NewObject()
o.Set("slice", m.vm.ToValue(m.Slice)) o.Set("slice", mo.vm.ToValue(mo.Slice))
o.Set("getUint", m.vm.ToValue(m.GetUint)) o.Set("getUint", mo.vm.ToValue(mo.GetUint))
o.Set("length", m.vm.ToValue(m.Length)) o.Set("length", mo.vm.ToValue(mo.Length))
return o return o
} }
@ -862,12 +862,12 @@ func (co *contractObj) GetInput() goja.Value {
return res return res
} }
func (c *contractObj) setupObject() *goja.Object { func (co *contractObj) setupObject() *goja.Object {
o := c.vm.NewObject() o := co.vm.NewObject()
o.Set("getCaller", c.vm.ToValue(c.GetCaller)) o.Set("getCaller", co.vm.ToValue(co.GetCaller))
o.Set("getAddress", c.vm.ToValue(c.GetAddress)) o.Set("getAddress", co.vm.ToValue(co.GetAddress))
o.Set("getValue", c.vm.ToValue(c.GetValue)) o.Set("getValue", co.vm.ToValue(co.GetValue))
o.Set("getInput", c.vm.ToValue(c.GetInput)) o.Set("getInput", co.vm.ToValue(co.GetInput))
return o return o
} }