1
0

add GoFunction to pushvalue

This commit is contained in:
Sky Johnson 2025-07-14 18:10:57 -05:00
parent cba8e1b151
commit cfea058d53

View File

@ -191,7 +191,6 @@ func (s *State) GetTableLength(index int) int {
return int(C.get_table_length(s.L, C.int(index))) return int(C.get_table_length(s.L, C.int(index)))
} }
// Enhanced PushValue with comprehensive type support
func (s *State) PushValue(v any) error { func (s *State) PushValue(v any) error {
switch val := v.(type) { switch val := v.(type) {
case nil: case nil:
@ -206,6 +205,8 @@ func (s *State) PushValue(v any) error {
s.PushNumber(val) s.PushNumber(val)
case string: case string:
s.PushString(val) s.PushString(val)
case GoFunction:
return s.PushGoFunction(val)
case []int: case []int:
return s.pushIntSlice(val) return s.pushIntSlice(val)
case []string: case []string: