ToUserData returns an interface{} of the userdata of the value at index. Otherwise, it returns nil. http://www.lua.org/manual/5.2/manual.html#lua_touserdata
(index int)
| 841 | // |
| 842 | // http://www.lua.org/manual/5.2/manual.html#lua_touserdata |
| 843 | func (l *State) ToUserData(index int) interface{} { |
| 844 | if d, ok := l.indexToValue(index).(*userData); ok { |
| 845 | return d.data |
| 846 | } |
| 847 | return nil |
| 848 | } |
| 849 | |
| 850 | // ToThread converts the value at index to a Lua thread (a State). This |
| 851 | // value must be a thread, otherwise the return value will be nil. |