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

Function SubTable

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

Source from the content-addressed store, hash-verified

419}
420
421func SubTable(l *State, index int, name string) bool {
422 l.Field(index, name)
423 if l.IsTable(-1) {
424 return true // table already there
425 }
426 l.Pop(1) // remove previous result
427 index = l.AbsIndex(index)
428 l.NewTable()
429 l.PushValue(-1) // copy to be left at top
430 l.SetField(index, name) // assign new table to field
431 return false // did not find table there
432}
433
434// Require calls function f with string name as an argument and sets the call
435// result in package.loaded[name], as if that function had been called

Callers 4

OpenLibrariesFunction · 0.85
hookTableFunction · 0.85
PackageOpenFunction · 0.85
RequireFunction · 0.85

Calls 7

FieldMethod · 0.80
IsTableMethod · 0.80
PopMethod · 0.80
AbsIndexMethod · 0.80
NewTableMethod · 0.80
PushValueMethod · 0.80
SetFieldMethod · 0.80

Tested by

no test coverage detected