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

Method frameFuncName

state.go:840–865  ·  view source on GitHub ↗
(fr *callFrame)

Source from the content-addressed store, hash-verified

838}
839
840func (ls *LState) frameFuncName(fr *callFrame) (string, bool) {
841 frame := fr.Parent
842 if frame == nil {
843 if ls.Parent == nil {
844 return "main chunk", true
845 } else {
846 return "corountine", true
847 }
848 }
849 if !frame.Fn.IsG {
850 pc := frame.Pc - 1
851 for _, call := range frame.Fn.Proto.DbgCalls {
852 if call.Pc == pc {
853 name := call.Name
854 if (name == "?" || fr.TailCall > 0) && !fr.Fn.IsG {
855 name = fmt.Sprintf("<%v:%v>", fr.Fn.Proto.SourceName, fr.Fn.Proto.LineDefined)
856 }
857 return name, false
858 }
859 }
860 }
861 if !fr.Fn.IsG {
862 return fmt.Sprintf("<%v:%v>", fr.Fn.Proto.SourceName, fr.Fn.Proto.LineDefined), false
863 }
864 return "(anonymous)", false
865}
866
867func (ls *LState) isStarted() bool {
868 return ls.currentFrame != nil

Callers 2

rawFrameFuncNameMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected