code: func (l *State) SetGlobal(name string) {
  	l.checkElementCount(1)
  	g := l.global.registry.atInt(RegistryIndexGlobals)
  	l.push(name)
  	l.setTableAt(g, l.stack[l.top-1], l.stack[l.top-2])
  	l.top -= 2 // pop value and key
  }
docs: // SetGlobal pops a value from the stack and sets it as the new value of
  // global name.
  //
  // http://www.lua.org/manual/5.2/manual.html#lua_setglobal