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

Function threadRun

_vm.go:133–161  ·  view source on GitHub ↗
(L *LState)

Source from the content-addressed store, hash-verified

131}
132
133func threadRun(L *LState) {
134 if L.stack.IsEmpty() {
135 return
136 }
137
138 defer func() {
139 if rcv := recover(); rcv != nil {
140 var lv LValue
141 if v, ok := rcv.(*ApiError); ok {
142 lv = v.Object
143 } else {
144 lv = LString(fmt.Sprint(rcv))
145 }
146 if parent := L.Parent; parent != nil {
147 if L.wrapped {
148 L.Push(lv)
149 parent.Panic(L)
150 } else {
151 L.SetTop(0)
152 L.Push(lv)
153 switchToParentThread(L, 1, true, true)
154 }
155 } else {
156 panic(rcv)
157 }
158 }
159 }()
160 L.mainLoop(L, nil)
161}
162
163type instFunc func(*LState, uint32, *callFrame) int
164

Callers

nothing calls this directly

Calls 5

LStringTypeAlias · 0.85
switchToParentThreadFunction · 0.70
IsEmptyMethod · 0.65
PushMethod · 0.65
SetTopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…