Skip to content

Trailing non-json whitespace is not rejected. #36

@rictic

Description

@rictic

Consider a simple input like the number 1 followed by a nonbreaking space: "1\u00A0"

JSON.parse correctly rejects this, but jsonriver v1.0.1 does not. Looks like we are using .trim() which skips a larger variety of space characters, instead of our strict skipPastWhitespace in expectEndOfContent.

This bug was reported over email by someone who says they found it with the assistance of GPT-5 high! Waiting to hear if they want public credit for finding this bug, but I'm quite thankful and impressed!

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