-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataType.getType("float").isValid(NaN) Returns true #2237
Comments
I understand that the inconsistency between The problem IMO is more with the whole process of parsing and validating string values taken from The use of the native So the question to me is, whether fixing the discrepancy between |
That was also my conclusive question that I asked myself. Ideally, it's both. But if I had to chose one, I'd favor a complete solution for #2166 to improve developer experience / error reporting. It's perfectly valid that
I think so too.
👍 |
I am logging this via 1880615058 for traceability and further internal discussions |
Note that commit 5aec8e6 was only meant to fix the inconsistency between the This has to be handled separately (kind of development request). I'll ask our PO how we want to track this (new internal incident, back log item or via #2166). |
URL (minimal example if possible)
https://openui5nightly.hana.ondemand.com
Steps to reproduce the problem:
sap.ui.base.DataType.getType("int").isValid(NaN);
==> Returnsfalse
sap.ui.base.DataType.getType("float").isValid(NaN);
==> Returnstrue
What is the expected result?
While it is true that
NaN
is of type number in JS, allowingNaN
to be valid in UI5 would also make this case valid:.. since parsing
"asdasdasd"
results inNaN
. Andtypeof NaN === "number"
returns true.openui5/src/sap.ui.core/src/sap/ui/base/DataType.js
Lines 399 to 404 in 0b901f6
I've had expected to get the error log implemented in 544ee13.
What happens instead?
No error is thrown.
The text was updated successfully, but these errors were encountered: