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

Method CheckString

auxlib.go:52–61  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

50}
51
52func (ls *LState) CheckString(n int) string {
53 v := ls.Get(n)
54 if lv, ok := v.(LString); ok {
55 return string(lv)
56 } else if LVCanConvToString(v) {
57 return ls.ToString(n)
58 }
59 ls.TypeError(n, LTString)
60 return ""
61}
62
63func (ls *LState) CheckBool(n int) bool {
64 v := ls.Get(n)

Callers 15

CheckOptionMethod · 0.95
loLoaderPreloadFunction · 0.80
loLoaderLuaFunction · 0.80
osExecuteFunction · 0.80
osDateFunction · 0.80
osGetEnvFunction · 0.80
osRemoveFunction · 0.80
osRenameFunction · 0.80
osSetEnvFunction · 0.80
baseLoadFileFunction · 0.80
baseLoadStringFunction · 0.80
loModuleFunction · 0.80

Calls 4

GetMethod · 0.95
ToStringMethod · 0.95
TypeErrorMethod · 0.95
LVCanConvToStringFunction · 0.85

Tested by 1

TestCheckStringFunction · 0.64