From a97422981b1dfb0eff8d36836cb0777a5ecb90ad Mon Sep 17 00:00:00 2001 From: unwox Date: Fri, 27 Sep 2024 15:34:16 +0600 Subject: return error when failing to recursively push an array or object onto the stack --- lua.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lua.go') diff --git a/lua.go b/lua.go index 4867d22..a400420 100644 --- a/lua.go +++ b/lua.go @@ -186,10 +186,10 @@ func (l *Lua) PushAny(v any) error { l.PushFloatNumber(v) case map[string]any: v, _ := v.(map[string]any) - l.PushObject(v) + return l.PushObject(v) case []any: v, _ := v.([]any) - l.PushArray(v) + return l.PushArray(v) case time.Time: v, _ := v.(time.Time) l.PushString(v.Format(time.DateTime)) -- cgit v1.2.3