(level int)
| 1588 | } |
| 1589 | |
| 1590 | func (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 | |
| 1607 | func (ls *LState) GetLocal(dbg *Debug, no int) (string, LValue) { |
| 1608 | frame := dbg.frame |
no test coverage detected