示例#1
0
文件: state.go 项目: halturin/luajit
// Creates & initializes a new State and returns a pointer to it. Returns
// nil on error.
func Newstate() *State {
	s := &State{C.newstate()}
	s.Newtable()
	s.Setglobal(namehooks)
	return s
}
示例#2
0
文件: state.go 项目: rdlaitila/leaf
// Creates & initializes a new State and returns a pointer to it. Returns
// nil on error.
func Newstate() *State {
	s := &State{l: C.newstate(), gfregistry: make(map[int]interface{})}
	s.Newtable()
	s.Setglobal(namehooks)
	return s
}