SetTable does the equivalent of table[key]=v, where table is the value at index, v is the value at the top of the stack and key is the value just below the top. The function pops both the key and the value from the stack. As in Lua, this function may trigger a metamethod for the __newindex event.
(index int)
| 1096 | // |
| 1097 | // http://www.lua.org/manual/5.2/manual.html#lua_settable |
| 1098 | func (l *State) SetTable(index int) { |
| 1099 | l.checkElementCount(2) |
| 1100 | l.setTableAt(l.indexToValue(index), l.stack[l.top-2], l.stack[l.top-1]) |
| 1101 | l.top -= 2 |
| 1102 | } |
| 1103 | |
| 1104 | // RawSet is similar to SetTable, but does a raw assignment (without |
| 1105 | // metamethods). |