(event, line int)
| 417 | } |
| 418 | |
| 419 | func (l *State) hook(event, line int) { |
| 420 | if l.hooker == nil || !l.allowHook { |
| 421 | return |
| 422 | } |
| 423 | ci := l.callInfo |
| 424 | top := l.top |
| 425 | ciTop := ci.top |
| 426 | ar := Debug{Event: event, CurrentLine: line, callInfo: ci} |
| 427 | l.checkStack(MinStack) |
| 428 | ci.setTop(l.top + MinStack) |
| 429 | l.assert(ci.top <= l.stackLast) |
| 430 | l.allowHook = false // can't hook calls inside a hook |
| 431 | ci.setCallStatus(callStatusHooked) |
| 432 | l.hooker(l, ar) |
| 433 | l.assert(!l.allowHook) |
| 434 | l.allowHook = true |
| 435 | ci.setTop(ciTop) |
| 436 | l.top = top |
| 437 | ci.clearCallStatus(callStatusHooked) |
| 438 | } |
| 439 | |
| 440 | func (l *State) initializeStack() { |
| 441 | l.stack = make([]value, basicStackSize) |
no test coverage detected