You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "100pah (via GitHub)" <gi...@apache.org> on 2025/06/01 13:08:07 UTC

Re: [PR] fix(data): avoid crashing with BigInt values [echarts]

100pah commented on code in PR #19847:
URL: https://github.com/apache/echarts/pull/19847#discussion_r2119132227


##########
src/data/helper/sourceHelper.ts:
##########
@@ -449,8 +449,8 @@ function doGuessOrdinal(
     function detectValue(val: OptionDataValue): BeOrdinalValue {
         const beStr = isString(val);
         // Consider usage convenience, '1', '2' will be treated as "number".
-        // `isFinit('')` get `true`.
-        if (val != null && isFinite(val as number) && val !== '') {
+        // `Number('')` (or any whitespace) is `0`.
+        if (val != null && Number.isFinite(Number(val)) && val !== '') {

Review Comment:
   Platform compatibility is a concern. @Ovilia 
   (I'll fix it later. add a polyfill)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org