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)
| 479 | // |
| 480 | // http://www.lua.org/manual/5.2/manual.html#lua_setfield |
| 481 | func (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 | |
| 489 | var none value = &struct{}{} |
| 490 |
no test coverage detected