You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some (~5) occurrences of isNaN usage in code, and no single test to understand their real purpose.
And that function is known to be not so obvious: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN
It's not straightforward to make sure that value is number, because boolean and empty string also coercing to numbers.
So I am not sure that our current usage is correct.
And more - instead of coercing numeric strings - I'd prefer throwing errors
Thus, we need to refactor that parts and cover them by tests.
The text was updated successfully, but these errors were encountered:
Just making sure that the value is convertible to number is not enough. Instead we should actually convert the value to number as early as possible (otherwise '5'+5 = '55').
There are some places in code vulnerable to this sort of bugs, and a number of open issues (too lazy to link them right now).
There are some (~5) occurrences of
isNaN
usage in code, and no single test to understand their real purpose.And that function is known to be not so obvious: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN
It's not straightforward to make sure that value is number, because boolean and empty string also coercing to numbers.
So I am not sure that our current usage is correct.
And more - instead of coercing numeric strings - I'd prefer throwing errors
Thus, we need to refactor that parts and cover them by tests.
The text was updated successfully, but these errors were encountered: