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

Method CheckTypes

auxlib.go:115–127  ·  view source on GitHub ↗
(n int, typs ...LValueType)

Source from the content-addressed store, hash-verified

113}
114
115func (ls *LState) CheckTypes(n int, typs ...LValueType) {
116 vt := ls.Get(n).Type()
117 for _, typ := range typs {
118 if vt == typ {
119 return
120 }
121 }
122 buf := []string{}
123 for _, typ := range typs {
124 buf = append(buf, typ.String())
125 }
126 ls.ArgError(n, strings.Join(buf, " or ")+" expected, got "+ls.Get(n).Type().String())
127}
128
129func (ls *LState) CheckOption(n int, options []string) int {
130 str := ls.CheckString(n)

Callers 7

baseSelectFunction · 0.80
baseSetMetatableFunction · 0.80
TestCheckTypesFunction · 0.80
fileWriteAuxFunction · 0.80
strGsubFunction · 0.80
debugGetInfoFunction · 0.80
debugSetMetatableFunction · 0.80

Calls 4

GetMethod · 0.95
ArgErrorMethod · 0.95
TypeMethod · 0.65
StringMethod · 0.65

Tested by 1

TestCheckTypesFunction · 0.64