MCPcopy Index your code
hub / github.com/yuin/gopher-lua / GetStack

Method GetStack

_state.go:1590–1605  ·  view source on GitHub ↗
(level int)

Source from the content-addressed store, hash-verified

1588}
1589
1590func (ls *LState) GetStack(level int) (*Debug, bool) {
1591 frame := ls.currentFrame
1592 for ; level > 0 && frame != nil; frame = frame.Parent {
1593 level--
1594 if !frame.Fn.IsG {
1595 level -= frame.TailCall
1596 }
1597 }
1598
1599 if level == 0 && frame != nil {
1600 return &Debug{frame: frame}, true
1601 } else if level < 0 && ls.stack.Sp() > 0 {
1602 return &Debug{frame: ls.stack.At(0)}, true
1603 }
1604 return &Debug{}, false
1605}
1606
1607func (ls *LState) GetLocal(dbg *Debug, no int) (string, LValue) {
1608 frame := dbg.frame

Callers 2

whereMethod · 0.95
stackTraceMethod · 0.95

Calls 2

SpMethod · 0.65
AtMethod · 0.65

Tested by

no test coverage detected