Skip to content

Make Infinity and NaN parsable, make isInfinite(NaN) return false#1160

Merged
konsoletyper merged 4 commits intokonsoletyper:masterfrom
lll69:master
Feb 24, 2026
Merged

Make Infinity and NaN parsable, make isInfinite(NaN) return false#1160
konsoletyper merged 4 commits intokonsoletyper:masterfrom
lll69:master

Conversation

@lll69
Copy link
Contributor

@lll69 lll69 commented Feb 24, 2026

Make Infinity and NaN parsable, and make isInfinite(NaN) return false in JS, fixes issue #1156 on JS and issue #1154

}

@Test
@SkipPlatform({ TestPlatform.WASI, TestPlatform.WEBASSEMBLY, TestPlatform.WEBASSEMBLY_GC, TestPlatform.C })
Copy link
Owner

Choose a reason for hiding this comment

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

What prevents you from implementing this on WasmGC backend?

public static native boolean isNaN(double v);

@JSBody(params = "v", script = "return !isFinite(v);")
@JSBody(params = "v", script = "return (!isFinite(v) && !isNaN(v));")
Copy link
Owner

Choose a reason for hiding this comment

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

I think the most straightforward implementation here would be just turn this method into non-native and call isNaN and isFinite from Java side. This will solve the issue with other backends

@lll69 lll69 changed the title Make Infinity and NaN parsable, make isInfinite(NaN) return false in JS Make Infinity and NaN parsable, make isInfinite(NaN) return false Feb 24, 2026
@lll69 lll69 requested a review from konsoletyper February 24, 2026 13:37
@konsoletyper
Copy link
Owner

Please, fix checkstyle errors

@konsoletyper konsoletyper merged commit 9be5eca into konsoletyper:master Feb 24, 2026
6 checks passed
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