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

Function internalHook

debug.go:424–440  ·  view source on GitHub ↗
(l *State, d Debug)

Source from the content-addressed store, hash-verified

422func hookTable(l *State) bool { return SubTable(l, RegistryIndex, "_HKEY") }
423
424func internalHook(l *State, d Debug) {
425 hookNames := []string{"call", "return", "line", "count", "tail call"}
426 hookTable(l)
427 l.PushThread()
428 l.RawGet(-2)
429 if l.IsFunction(-1) {
430 l.PushString(hookNames[d.Event])
431 if d.CurrentLine >= 0 {
432 l.PushInteger(d.CurrentLine)
433 } else {
434 l.PushNil()
435 }
436 _, ok := Info(l, "lS", d.callInfo)
437 l.assert(ok)
438 l.Call(2, 0)
439 }
440}
441
442func maskToString(mask byte) (s string) {
443 if mask&MaskCall != 0 {

Callers

nothing calls this directly

Calls 10

hookTableFunction · 0.85
InfoFunction · 0.85
PushThreadMethod · 0.80
RawGetMethod · 0.80
IsFunctionMethod · 0.80
PushStringMethod · 0.80
PushIntegerMethod · 0.80
PushNilMethod · 0.80
CallMethod · 0.80
assertMethod · 0.45

Tested by

no test coverage detected