Skip to content

Reject blank float arguments instead of silently using zero - #191

Closed
oyeong011 wants to merge 1 commit into
nodeca:masterfrom
oyeong011:fix/verified-regression
Closed

oyeong011 wants to merge 1 commit into
nodeca:masterfrom
oyeong011:fix/verified-regression

Conversation

@oyeong011

Copy link
Copy Markdown

The float converter passes blank strings into Number(), which returns zero. Reject empty/whitespace-only strings while preserving surrounding whitespace on valid numeric input.

The regression fails before the change and passes afterward. Coverage includes empty, space-only, tab/newline-only input plus valid padded numeric strings.

Validation: ESLint and the full 1,831-test suite pass using Node 22. Public API QA also passes Node 26.

AI assistance: OpenAI Codex was used to investigate, implement, and run the regression and full-suite checks.

The float converter passes blank strings into Number(), which returns zero. Reject empty/whitespace-only strings while preserving surrounding whitespace on valid numeric input.

Confidence: high
Scope-risk: narrow
Tested: Regression red/green, full test suite, exported API QA
@puzrin

puzrin commented Sep 8, 2026

Copy link
Copy Markdown
Member

What is the reason for this PR? This is mainstreem port, deviations are not accepted, and your custom test will not be maintainable.

@puzrin puzrin closed this in 28c7449 Sep 10, 2026
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