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

Function Stack

debug.go:193–204  ·  view source on GitHub ↗

Stack gets information about the interpreter runtime stack. It returns a Frame identifying the activation record of the function executing at a given level. Level 0 is the current running function, whereas level n+1 is the function that has called level n (except for tail calls, which do not count

(l *State, level int)

Source from the content-addressed store, hash-verified

191// Stack returns true; when called with a level greater than the stack depth,
192// it returns false.
193func Stack(l *State, level int) (f Frame, ok bool) {
194 if level < 0 {
195 return // invalid (negative) level
196 }
197 callInfo := l.callInfo
198 for ; level > 0 && callInfo != &l.baseCallInfo; level, callInfo = level-1, callInfo.previous {
199 }
200 if level == 0 && callInfo != &l.baseCallInfo { // level found?
201 f, ok = callInfo, true
202 }
203 return
204}
205
206func functionInfo(p Debug, f closure) (d Debug) {
207 d = p

Callers 4

countLevelsFunction · 0.85
TracebackFunction · 0.85
ArgumentErrorFunction · 0.85
WhereFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…