fix check if value is in array

This commit is contained in:
2023-06-22 23:59:20 +01:00
parent 9b3f3d1555
commit f63229c6f8
3 changed files with 2 additions and 3 deletions

View File

@@ -583,7 +583,7 @@ func ArArray(arr []any) ArObject {
}
for _, v := range arr {
res, err := runOperation(operationType{
operation: 8,
operation: 9,
value1: v,
value2: args[0],
}, stack{}, 0)

View File

@@ -806,7 +806,7 @@ func equals(a any, b any, o operationType, stack stack, stacklevel int) (bool, A
}
}
if x, ok := b.(ArObject); ok {
if y, ok := x.obj["__GreaterThanEqual__"]; ok {
if y, ok := x.obj["__Equal__"]; ok {
val, err := runCall(
call{
y,

View File

@@ -553,7 +553,6 @@ func ArString(str string) ArObject {
return nil, ArErr{"TypeError", "expected 1 argument, got " + fmt.Sprint(len(a)), 0, "", "", true}
}
a[0] = ArValidToAny(a[0])
fmt.Println(str, a[0])
return str != a[0], ArErr{}
}}
obj.obj["__Add__"] = builtinFunc{