(l *State, index int, name string)
| 267 | } |
| 268 | |
| 269 | func TestUserData(l *State, index int, name string) interface{} { |
| 270 | if d := l.ToUserData(index); d != nil { |
| 271 | if l.MetaTable(index) { |
| 272 | if MetaTableNamed(l, name); !l.RawEqual(-1, -2) { |
| 273 | d = nil |
| 274 | } |
| 275 | l.Pop(2) |
| 276 | return d |
| 277 | } |
| 278 | } |
| 279 | return nil |
| 280 | } |
| 281 | |
| 282 | // CheckUserData checks whether the function argument at index is a userdata |
| 283 | // of the type name (see NewMetaTable) and returns the userdata (see |
no test coverage detected