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

Method SetField

lua.go:481–487  ·  view source on GitHub ↗

SetField does the equivalent of table[key]=v where table is the value at index and v is the value on top of the stack. This function pops the value from the stack. As in Lua, this function may trigger a metamethod for the __newindex event. http://www.lua.org/manual/5.2/manual.html#lua_setfield

(index int, key string)

Source from the content-addressed store, hash-verified

479//
480// http://www.lua.org/manual/5.2/manual.html#lua_setfield
481func (l *State) SetField(index int, key string) {
482 l.checkElementCount(1)
483 t := l.indexToValue(index)
484 l.push(key)
485 l.setTableAt(t, key, l.stack[l.top-2])
486 l.top -= 2
487}
488
489var none value = &struct{}{}
490

Callers 15

OpenLibrariesFunction · 0.80
debug.goFile · 0.80
BaseOpenFunction · 0.80
StringOpenFunction · 0.80
table.goFile · 0.80
ioFileHelperFunction · 0.80
registerStdFileFunction · 0.80
IOOpenFunction · 0.80
setPathFunction · 0.80
PackageOpenFunction · 0.80
MathOpenFunction · 0.80
NewMetaTableFunction · 0.80

Calls 4

checkElementCountMethod · 0.95
indexToValueMethod · 0.95
pushMethod · 0.95
setTableAtMethod · 0.95

Tested by

no test coverage detected