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

Method raiseError

_state.go:635–652  ·  view source on GitHub ↗

+inline-end

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

Source from the content-addressed store, hash-verified

633} // +inline-end
634
635func (ls *LState) raiseError(level int, format string, args ...interface{}) {
636 if !ls.hasErrorFunc {
637 ls.closeAllUpvalues()
638 }
639 message := format
640 if len(args) > 0 {
641 message = fmt.Sprintf(format, args...)
642 }
643 if level > 0 {
644 message = fmt.Sprintf("%v %v", ls.where(level-1, true), message)
645 }
646 if ls.reg.IsFull() {
647 // if the registry is full then it won't be possible to push a value, in this case, force a larger size
648 ls.reg.forceResize(ls.reg.Top() + 1)
649 }
650 ls.reg.Push(LString(message))
651 ls.Panic(ls)
652}
653
654func (ls *LState) findLocal(frame *callFrame, no int) string {
655 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