MCPcopy Create free account
hub / github.com/yuin/gopher-lua / where

Method where

state.go:775–793  ·  view source on GitHub ↗
(level int, skipg bool)

Source from the content-addressed store, hash-verified

773}
774
775func (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
795func (ls *LState) stackTrace(level int) string {
796 buf := []string{}

Callers 2

WhereMethod · 0.95
raiseErrorMethod · 0.95

Calls 1

GetStackMethod · 0.95

Tested by

no test coverage detected