RawLength returns the length of the value at index. For strings, this is the length. For tables, this is the result of the # operator with no metamethods. For userdata, this is the size of the block of memory allocated for the userdata (not implemented yet). For other values, it is 0. http://www
(index int)
| 811 | // |
| 812 | // http://www.lua.org/manual/5.2/manual.html#lua_rawlen |
| 813 | func (l *State) RawLength(index int) int { |
| 814 | switch v := l.indexToValue(index).(type) { |
| 815 | case string: |
| 816 | return len(v) |
| 817 | // case *userData: |
| 818 | // return reflect.Sizeof(v.data) |
| 819 | case *table: |
| 820 | return v.length() |
| 821 | } |
| 822 | return 0 |
| 823 | } |
| 824 | |
| 825 | // ToGoFunction converts a value at index into a Go function. That value |
| 826 | // must be a Go function, otherwise it returns nil. |
no test coverage detected