func (fr *Frame) function() *Closure {
	if fr != nil && fr.closure != nil {
		return fr.closure
	}
	return nil
}
function returns the frame closure.
package lua
import "github.com/Azure/golua/lua/vm"
type callStatus uint
const (
	callStatusAllowHook = 1 << iota  
	callStatusTail  
)
type (
	CallInfo struct {
	}
	Frame struct {
		prev, next *Frame            
		closure    *Closure          
		vararg     []Value           
		locals     []Value           
		state      *State            
		depth      int               
		fnID       int               
		rets       int               
		pc         int               
		up         map[int]*upValue  
		status     callStatus        
	}
)
func (fr *Frame) checkstack(needed int) bool {
	if space := cap(fr.locals) - fr.gettop(); space < needed {
		fr.extend(needed - space)
	}
	return true
}
func (fr *Frame) extend(grow int) {
	fr.locals = append(
		fr.locals,
		make([]Value, grow, grow)...,
	)[:len(fr.locals)]
}
func (fr *Frame) absindex(index int) int {
	if index > 0 || isPseudoIndex(index) {
		return index
	}
	return fr.gettop() + index + 1
}
func (fr *Frame) settop(top int) {
	switch diff := fr.gettop() - top; {
	case diff >= 0:  
		for i := 0; i < diff; i++ {
			fr.pop()
		}
	case diff < 0:  
		for i := 0; i > diff; i-- {
			fr.push(None)
		}
	}
}
func (fr *Frame) reverse(src, dst int) {
	for locals := fr.locals; src < dst; {
		locals[src], locals[dst] = locals[dst], locals[src]
		src++
		dst--
	}
}