MCPcopy Index your code
hub / github.com/yuin/gopher-lua / CheckType

Method CheckType

auxlib.go:108–113  ·  view source on GitHub ↗
(n int, typ LValueType)

Source from the content-addressed store, hash-verified

106}
107
108func (ls *LState) CheckType(n int, typ LValueType) {
109 v := ls.Get(n)
110 if v.Type() != typ {
111 ls.TypeError(n, typ)
112 }
113}
114
115func (ls *LState) CheckTypes(n int, typs ...LValueType) {
116 vt := ls.Get(n).Type()

Callers 1

TestCheckTypeFunction · 0.80

Calls 3

GetMethod · 0.95
TypeErrorMethod · 0.95
TypeMethod · 0.65

Tested by 1

TestCheckTypeFunction · 0.64