code: func (l *State) SetUserValue(index int) {
  	l.checkElementCount(1)
  	d := l.indexToValue(index).(*userData)
  	if l.stack[l.top-1] == nil {
  		d.env = nil
  	} else {
  		t := l.stack[l.top-1].(*table)
  		d.env = t
  	}
  	l.top--
  }
docs: // 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