add luafunction pointer to pushvalue
This commit is contained in:
parent
cfea058d53
commit
d2b65ffde4
@ -207,6 +207,12 @@ func (s *State) PushValue(v any) error {
|
|||||||
s.PushString(val)
|
s.PushString(val)
|
||||||
case GoFunction:
|
case GoFunction:
|
||||||
return s.PushGoFunction(val)
|
return s.PushGoFunction(val)
|
||||||
|
case *LuaFunction:
|
||||||
|
C.lua_rawgeti(s.L, C.LUA_REGISTRYINDEX, C.int(val.ref))
|
||||||
|
if val.ref == C.LUA_NOREF || val.ref == C.LUA_REFNIL {
|
||||||
|
s.Pop(1)
|
||||||
|
s.PushNil()
|
||||||
|
}
|
||||||
case []int:
|
case []int:
|
||||||
return s.pushIntSlice(val)
|
return s.pushIntSlice(val)
|
||||||
case []string:
|
case []string:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user