(level int, skipg bool)
| 773 | } |
| 774 | |
| 775 | func (ls *LState) where(level int, skipg bool) string { |
| 776 | dbg, ok := ls.GetStack(level) |
| 777 | if !ok { |
| 778 | return "" |
| 779 | } |
| 780 | cf := dbg.frame |
| 781 | proto := cf.Fn.Proto |
| 782 | sourcename := "[G]" |
| 783 | if proto != nil { |
| 784 | sourcename = proto.SourceName |
| 785 | } else if skipg { |
| 786 | return ls.where(level+1, skipg) |
| 787 | } |
| 788 | line := "" |
| 789 | if proto != nil { |
| 790 | line = fmt.Sprintf("%v:", proto.DbgSourcePositions[cf.Pc-1]) |
| 791 | } |
| 792 | return fmt.Sprintf("%v:%v", sourcename, line) |
| 793 | } |
| 794 | |
| 795 | func (ls *LState) stackTrace(level int) string { |
| 796 | buf := []string{} |
no test coverage detected