tableSet method

void tableSet([
  1. int tableIndex = -3
])

Pops a key and value, then adds those to the table at tableIndex.

This does not pop the table, Example:

state.newTable();
state.push("myKey");
state.push("myValue");
state.tableSet();
// Top of stack is now: {myKey = "myValue"}

If the table has a __newindex metamethod, this may invoke it, to avoid this behavior see LuaState.tableSetRaw

Implementation

void tableSet([int tableIndex = -3]) => lua_settable(L, tableIndex);