Skip to content
Snippets Groups Projects
Commit 05a104be authored by ale's avatar ale
Browse files

Make the int-map lookup return 0 by default

parent 97c50619
No related branches found
No related tags found
No related merge requests found
Pipeline #15063 passed
......@@ -42,10 +42,13 @@ func (m intMap) IndexGet(index tengo.Object) (tengo.Object, error) {
if !ok {
return nil, tengo.ErrInvalidIndexType
}
value, ok := m[indexStr.Value]
if !ok {
return tengo.UndefinedValue, nil
}
// value, ok := m[indexStr.Value]
// if !ok {
// return tengo.UndefinedValue, nil
// }
value := m[indexStr.Value]
return &tengo.Int{Value: value}, nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment