MCPcopy Create free account
hub / github.com/yuin/gopher-lua / OptTable

Method OptTable

auxlib.go:204–214  ·  view source on GitHub ↗
(n int, d *LTable)

Source from the content-addressed store, hash-verified

202}
203
204func (ls *LState) OptTable(n int, d *LTable) *LTable {
205 v := ls.Get(n)
206 if v == LNil {
207 return d
208 }
209 if lv, ok := v.(*LTable); ok {
210 return lv
211 }
212 ls.TypeError(n, LTTable)
213 return nil
214}
215
216func (ls *LState) OptFunction(n int, d *LFunction) *LFunction {
217 v := ls.Get(n)

Callers 1

TestOptTableFunction · 0.80

Calls 2

GetMethod · 0.95
TypeErrorMethod · 0.95

Tested by 1

TestOptTableFunction · 0.64