MCPcopy Index your code
hub / github.com/Shopify/go-lua / hook

Method hook

stack.go:419–438  ·  view source on GitHub ↗
(event, line int)

Source from the content-addressed store, hash-verified

417}
418
419func (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
440func (l *State) initializeStack() {
441 l.stack = make([]value, basicStackSize)

Callers 4

traceExecutionMethod · 0.95
callGoMethod · 0.95
callHookMethod · 0.95
postCallMethod · 0.95

Calls 5

checkStackMethod · 0.95
assertMethod · 0.95
setTopMethod · 0.80
setCallStatusMethod · 0.80
clearCallStatusMethod · 0.80

Tested by

no test coverage detected