mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
prevent unhashable panic
This commit is contained in:
@@ -42,6 +42,10 @@ func init() {
|
||||
switch y := v.(type) {
|
||||
case ArArray:
|
||||
if len(y) == 2 {
|
||||
keytype := typeof(y[0])
|
||||
if keytype == "array" || keytype == "map" {
|
||||
return nil, ArErr{TYPE: "TypeError", message: "Cannot use unhashable value as key: " + keytype, EXISTS: true}
|
||||
}
|
||||
newmap[y[0]] = y[1]
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user