make arrays an object

This commit is contained in:
2023-03-15 21:02:00 +00:00
parent b53f2b4a0a
commit 814209c392
24 changed files with 545 additions and 325 deletions

View File

@@ -12,8 +12,11 @@ func anyToBool(x any) bool {
return x
case nil:
return false
case ArMap:
return len(x) != 0
case ArObject:
if x.TYPE == "array" {
return len(x.obj["__value__"].([]any)) != 0
}
return len(x.obj) != 0
case builtinFunc:
return true
case Callable: