summaryrefslogtreecommitdiff
path: root/lua.go
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-09-27 15:34:16 +0600
committerunwox <me@unwox.com>2024-09-27 15:34:16 +0600
commita97422981b1dfb0eff8d36836cb0777a5ecb90ad (patch)
tree93f0654ee8c2504dd9be6557e6722ac8ef6d9ddd /lua.go
parent81a1002523eb7ac78fb2a55e070e7058ca31c0e0 (diff)
return error when failing to recursively push an array or object onto the stack
Diffstat (limited to 'lua.go')
-rw-r--r--lua.go4
1 files changed, 2 insertions, 2 deletions
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))