(n int)
| 1445 | } |
| 1446 | |
| 1447 | func (ls *LState) ToInt(n int) int { |
| 1448 | if lv, ok := ls.Get(n).(LNumber); ok { |
| 1449 | return int(lv) |
| 1450 | } |
| 1451 | if lv, ok := ls.Get(n).(LString); ok { |
| 1452 | if num, err := parseNumber(string(lv)); err == nil { |
| 1453 | return int(num) |
| 1454 | } |
| 1455 | } |
| 1456 | return 0 |
| 1457 | } |
| 1458 | |
| 1459 | func (ls *LState) ToInt64(n int) int64 { |
| 1460 | if lv, ok := ls.Get(n).(LNumber); ok { |
nothing calls this directly
no test coverage detected