Skip to content

Negative array indexes throw errors instead of empty matches if outside of range #203

@torbenw

Description

@torbenw
  • When trying to get a non-existing value in an array with a positive index value, the returned matches are empty (correct)
  • When trying to get a non-existing value in an array with a negative index value, an error "list index out of range" is returned instead (wrong)

Example data:

[
  "text"
]

Example expressions:
[0] -> returns "text"
[1] -> returns an empty matches list
[-1] -> returns "text"
[-2] -> throws IndexError "list index out of range"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions