SetUserValue pops a table or nil from the stack and sets it as the new value associated to the userdata at index. http://www.lua.org/manual/5.2/manual.html#lua_setuservalue
(index int)
| 1132 | // |
| 1133 | // http://www.lua.org/manual/5.2/manual.html#lua_setuservalue |
| 1134 | func (l *State) SetUserValue(index int) { |
| 1135 | l.checkElementCount(1) |
| 1136 | d := l.indexToValue(index).(*userData) |
| 1137 | if l.stack[l.top-1] == nil { |
| 1138 | d.env = nil |
| 1139 | } else { |
| 1140 | t := l.stack[l.top-1].(*table) |
| 1141 | d.env = t |
| 1142 | } |
| 1143 | l.top-- |
| 1144 | } |
| 1145 | |
| 1146 | // SetMetaTable pops a table from the stack and sets it as the new metatable |
| 1147 | // for the value at index. |
no test coverage detected