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

Method AbsIndex

lua.go:541–546  ·  view source on GitHub ↗

AbsIndex converts the acceptable index index to an absolute index (that is, one that does not depend on the stack top). http://www.lua.org/manual/5.2/manual.html#lua_absindex

(index int)

Source from the content-addressed store, hash-verified

539//
540// http://www.lua.org/manual/5.2/manual.html#lua_absindex
541func (l *State) AbsIndex(index int) int {
542 if index > 0 || isPseudoIndex(index) {
543 return index
544 }
545 return l.top - l.callInfo.function + index
546}
547
548// SetTop accepts any index, or 0, and sets the stack top to index. If the
549// new top is larger than the old one, then the new elements are filled with

Callers 5

RemoveMethod · 0.95
InsertMethod · 0.95
CallMetaFunction · 0.80
SubTableFunction · 0.80

Calls 1

isPseudoIndexFunction · 0.85

Tested by

no test coverage detected