Skip to content

Improve JSON correctness for math.huge, nan, and massive serialization parts#1105

Open
Nicell wants to merge 2 commits into
luau-lang:primaryfrom
Nicell:json-correctness
Open

Improve JSON correctness for math.huge, nan, and massive serialization parts#1105
Nicell wants to merge 2 commits into
luau-lang:primaryfrom
Nicell:json-correctness

Conversation

@Nicell
Copy link
Copy Markdown
Collaborator

@Nicell Nicell commented May 16, 2026

Improves @std/json correctness around two serialization edge cases:

  • Rejects non-finite numbers (math.huge, -math.huge, math.nan) instead of emitting invalid JSON tokens
    • We could alternatively emit null if we don't want to be as annoying with errors and match what some serializers do, curious if there are any opinions on this
  • Grows the serialization buffer until the pending write fits, fixing failures for very large strings or object keys

Comment thread lute/std/libs/json.luau Outdated
Co-authored-by: Noah Winn <111249648+nwinn-student@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants