-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Incorrect type-test of Infinity and NaN #562
Comments
This comment was originally written by [email protected] Added Area-Compiler, Triaged labels. |
This comment was originally written by [email protected] These are runtime decisions made by trying to determine the dart type of a JS Number. Shouldn't affect dartc static analysis since code generation is removed. Unassigning from dartc as the other JS compilers likely have the same issue. Removed Area-Compiler label. |
Added Area-Dart2JS, Triaged labels. |
Changed the title to: "Incorrect type-test of Infinity and NaN". |
We do not treat infinity and NaN as ints in dart2js. Added Fixed label. |
This issue was originally filed by [email protected]
~/projects/dart % cat nan_inf_type.dart
main() {
var inf = double.INFINITY;
var nan = double.NAN;
print("$inf is int: ${inf is int}, is double: ${inf is double}, is num: ${inf is num}");
print("$nan is int: ${nan is int}, is double: ${nan is double}, is num: ${nan is num}");
}
~/projects/dart % dart nan_inf_type.dart
Infinity is int: false, is double: true, is num: true
NaN is int: false, is double: true, is num: true
~/projects/dart % dart/frog/frogsh nan_inf_type.dart
Infinity is int: true, is double: true, is num: true
NaN is int: true, is double: true, is num: true
Frog and dartc should match the vm, i.e. Infinity and NaN is! int.
The text was updated successfully, but these errors were encountered: