Added the possibility for debug hooks during closure call

This commit is contained in:
obscuren
2014-04-11 08:28:30 -04:00
parent 7d6ba88d2b
commit ca747f2688
4 changed files with 12 additions and 45 deletions

View File

@ -69,10 +69,12 @@ func (c *Closure) Address() []byte {
return c.object.Address()
}
func (c *Closure) Call(vm *Vm, args []byte) []byte {
type DebugHook func(op OpCode)
func (c *Closure) Call(vm *Vm, args []byte, hook DebugHook) []byte {
c.Args = args
return vm.RunClosure(c)
return vm.RunClosure(c, hook)
}
func (c *Closure) Return(ret []byte) []byte {