// 9223372036854775807 (Int64.MAX).@sig...@google.com We have some funky behavior for dart2js. Is this expected?
For the large ints, the compiler refuses for to compile. But for these values it does something weird.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
// 9223372036854775807 (Int64.MAX).@sig...@google.com We have some funky behavior for dart2js. Is this expected?
For the large ints, the compiler refuses for to compile. But for these values it does something weird.
Yes!
dart2js maps all numbers to JS numbers, which have 53-bit of precision. In dart2js our int implementation is a subtype of double. That's why you can use `1.0 == 1` to test whether you are running in a JS backend vs dart2wasm or the VM. We map any number whose floor equal to itself to the `int` type.
Check out this article that shares a lot more details: https://dart.dev/resources/language/number-representation
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
[record_use] Support `double` constants
Quirks:
- JS backend compiles some values to ints instead of doubles.
Closes: https://github.com/dart-lang/native/issues/3221
TEST=pkg/compiler/test/record_use/record_use_test.dart
TEST=pkg/dart2wasm/test/record_use_test.dart
TEST=pkg/vm/test/transformations/record_use_test.dart
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |