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

Method raiseError

state.go:735–752  ·  view source on GitHub ↗

+inline-end

(level int, format string, args ...interface{})

Source from the content-addressed store, hash-verified

733} // +inline-end
734
735func (ls *LState) raiseError(level int, format string, args ...interface{}) {
736 if !ls.hasErrorFunc {
737 ls.closeAllUpvalues()
738 }
739 message := format
740 if len(args) > 0 {
741 message = fmt.Sprintf(format, args...)
742 }
743 if level > 0 {
744 message = fmt.Sprintf("%v %v", ls.where(level-1, true), message)
745 }
746 if ls.reg.IsFull() {
747 // if the registry is full then it won't be possible to push a value, in this case, force a larger size
748 ls.reg.forceResize(ls.reg.Top() + 1)
749 }
750 ls.reg.Push(LString(message))
751 ls.Panic(ls)
752}
753
754func (ls *LState) findLocal(frame *callFrame, no int) string {
755 fn := frame.Fn

Callers 2

RaiseErrorMethod · 0.95
ErrorMethod · 0.95

Calls 7

closeAllUpvaluesMethod · 0.95
whereMethod · 0.95
LStringTypeAlias · 0.85
IsFullMethod · 0.65
PushMethod · 0.65
forceResizeMethod · 0.45
TopMethod · 0.45

Tested by

no test coverage detected