Compare commits
No commits in common. "master" and "v0.5.5" have entirely different histories.
@ -302,8 +302,3 @@ func (s *State) GetAllLuaFunctions(names ...string) (map[string]*LuaFunction, er
|
||||
}
|
||||
return funcs, nil
|
||||
}
|
||||
|
||||
// PushLuaFunction pushes a stored LuaFunction reference onto the stack
|
||||
func (s *State) PushLuaFunction(lf *LuaFunction) {
|
||||
C.lua_rawgeti(s.L, C.LUA_REGISTRYINDEX, C.int(lf.ref))
|
||||
}
|
||||
|
@ -191,6 +191,7 @@ func (s *State) GetTableLength(index int) int {
|
||||
return int(C.get_table_length(s.L, C.int(index)))
|
||||
}
|
||||
|
||||
// Enhanced PushValue with comprehensive type support
|
||||
func (s *State) PushValue(v any) error {
|
||||
switch val := v.(type) {
|
||||
case nil:
|
||||
@ -205,14 +206,6 @@ func (s *State) PushValue(v any) error {
|
||||
s.PushNumber(val)
|
||||
case string:
|
||||
s.PushString(val)
|
||||
case GoFunction:
|
||||
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:
|
||||
return s.pushIntSlice(val)
|
||||
case []string:
|
||||
|
Loading…
x
Reference in New Issue
Block a user