MCPcopy Index your code
hub / github.com/Shopify/go-lua / UserValue

Method UserValue

lua.go:1069–1076  ·  view source on GitHub ↗

UserValue pushes onto the stack the Lua value associated with the userdata at index. This value must be a table or nil. http://www.lua.org/manual/5.2/manual.html#lua_getuservalue

(index int)

Source from the content-addressed store, hash-verified

1067//
1068// http://www.lua.org/manual/5.2/manual.html#lua_getuservalue
1069func (l *State) UserValue(index int) {
1070 d := l.indexToValue(index).(*userData)
1071 if d.env == nil {
1072 l.apiPush(nil)
1073 } else {
1074 l.apiPush(d.env)
1075 }
1076}
1077
1078// SetGlobal pops a value from the stack and sets it as the new value of
1079// global name.

Callers 1

debug.goFile · 0.80

Calls 2

indexToValueMethod · 0.95
apiPushMethod · 0.95

Tested by

no test coverage detected