You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, I should read properly first :D
Yes, this is a bug.
This is due to unchecked conversion from f64 (all jsonnet numbers are f64) to usize using num as usize, where negative numbers are rounded to zero, in array indexing implementation.
In jrsonnet, any negative index of a non-empty array returns the first element. In go-jsonnet, it is an out-of-bounds error.
jrsonnet:
go-jsonnet on the same file:
Negative index on an empty array does fail, but with the wrong index value:
[][-1]
jrsonnet:
go-jsonnet:
The text was updated successfully, but these errors were encountered: