Skip to content

Add coverage for number conversion in JSON.stringify and Array.p.join - #5145

Merged
Ms2ger merged 1 commit into
tc39:mainfrom
ptomato:number-conversion-tests
Oct 8, 2026
Merged

Ms2ger merged 1 commit into
tc39:mainfrom
ptomato:number-conversion-tests

Conversation

@ptomato

@ptomato ptomato commented Oct 7, 2026

Copy link
Copy Markdown
Member

There was minimal coverage of Number values in these functions, except that JSON.stringify had coverage for -0 and infinities/NaNs. This coverage would be helpful for some optimizations I'm working on.

LLM disclosure: I used a bot to make a first draft of these tests, which I then edited to be more readable and to-the-point.

There was minimal coverage of Number values in these functions, except
that JSON.stringify had coverage for -0 and infinities/NaNs. This
coverage would be helpful for some optimizations I'm working on.

LLM disclosure: I used a bot to make a first draft of these tests, which
I then edited to be more readable and to-the-point.
@ptomato
ptomato requested a review from a team as a code owner October 7, 2026 22:51
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

2 new or modified tests were run on 7 engines.

View workflow run

Test Engine262 GraalJS JavaScriptCore QuickJS SpiderMonkey V8 XS
built-ins/Array/prototype/join/number-elements.js ✅ ✅ ✅ ✅ ✅ ✅ ✅
built-ins/JSON/stringify/value-number.js ✅ ✅ ✅ ✅ ✅ ✅ ✅

@Ms2ger Ms2ger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, why not. TIL that NaN and infinities serialize to "null" in JSON.

@Ms2ger
Ms2ger merged commit 2e0a567 into tc39:main Oct 8, 2026
17 checks passed
@ptomato
ptomato deleted the number-conversion-tests branch October 8, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants