MCPcopy Index your code
hub / github.com/Shopify/go-lua / TestUserData

Function TestUserData

auxiliary.go:269–280  ·  view source on GitHub ↗
(l *State, index int, name string)

Source from the content-addressed store, hash-verified

267}
268
269func 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

Callers 2

io.goFile · 0.85
CheckUserDataFunction · 0.85

Calls 5

MetaTableNamedFunction · 0.85
ToUserDataMethod · 0.80
MetaTableMethod · 0.80
RawEqualMethod · 0.80
PopMethod · 0.80

Tested by

no test coverage detected