(f func(*State, int, int) (string, bool), returnValueCount int)
| 391 | } |
| 392 | |
| 393 | func upValueHelper(f func(*State, int, int) (string, bool), returnValueCount int) Function { |
| 394 | return func(l *State) int { |
| 395 | CheckType(l, 1, TypeFunction) |
| 396 | name, ok := f(l, 1, CheckInteger(l, 2)) |
| 397 | if !ok { |
| 398 | return 0 |
| 399 | } |
| 400 | l.PushString(name) |
| 401 | l.Insert(-returnValueCount) |
| 402 | return returnValueCount |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | func (l *State) checkUpValue(f, upValueCount int) int { |
| 407 | n := CheckInteger(l, upValueCount) |
no test coverage detected