Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Array evaluation currently accepts signed and zero-padded indices (
-0,+0,+1,00,01), and a negative index such as-1panics when indexing the slice. These tokens do not satisfy the array-index grammar in RFC 6901 section 4.Require the parsed index to be nonnegative and to round-trip to the same decimal token before indexing. This keeps overflow and out-of-bounds errors intact. The restriction applies only while evaluating arrays: object properties named
-1,01, etc. remain accessible.Regression coverage includes negative/signed/zero-padded, empty, append-marker, fractional, and overflowing tokens, with matching object-key checks. Before the fix the negative case panics and five other cases return an array value instead of an error.
Validation: full Go 1.27.1 race/coverage suite,
go vet,golint -set_exit_status, formatting/diff checks, and full Go 1.9.7 tests pass. Go 1.14.15 also passes. Tests ran on Linux/arm64.AI assistance: implementation and tests were developed and verified with an AI coding agent.