Use Number.isNaN instead of global isNaN in saxy XML parser - #1235
Use Number.isNaN instead of global isNaN in saxy XML parser#1235pavankumar-vh wants to merge 1 commit into
Conversation
The global isNaN() function coerces non-numbers to numbers first, which can lead to unexpected results. Using Number.isNaN is more predictable and safer for type checking.
|
Correct and safe change: The change is minimal, in scope ( |
Overview
Fix type safety issue in
common/src/util/saxy.tsby usingNumber.isNaNinstead of the globalisNaNfunction.Bug Description
The global
isNaN()function coerces non-numbers to numbers first, which can lead to unexpected results.Fix
Changed
isNaN(value)toNumber.isNaN(value)for more predictable and safer type checking.Testing
No existing tests for this function, but the fix improves type safety.
Files Changed
common/src/util/saxy.ts- Use Number.isNaN instead of global isNaNScope
This change only touches
common/which is an approved contribution area per the Contributing Guide.