(f func(), oldTop, errorFunc int)
| 1237 | } |
| 1238 | |
| 1239 | func (l *State) protectedCall(f func(), oldTop, errorFunc int) error { |
| 1240 | callInfo, allowHook, nonYieldableCallCount, errorFunction := l.callInfo, l.allowHook, l.nonYieldableCallCount, l.errorFunction |
| 1241 | l.errorFunction = errorFunc |
| 1242 | err := l.protect(f) |
| 1243 | if err != nil { |
| 1244 | l.close(oldTop) |
| 1245 | l.setErrorObject(err, oldTop) |
| 1246 | l.callInfo, l.allowHook, l.nonYieldableCallCount = callInfo, allowHook, nonYieldableCallCount |
| 1247 | // TODO l.shrinkStack() |
| 1248 | } |
| 1249 | l.errorFunction = errorFunction |
| 1250 | return err |
| 1251 | } |
| 1252 | |
| 1253 | // UpValue returns the name of the upvalue at index away from function, |
| 1254 | // where index cannot be greater than the number of upvalues. |
no test coverage detected