dart-lang / sdk

The Dart SDK, including the VM, dart2js, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
9.94k stars 1.53k forks source link

Javascript platform does not distinguish between int and double values #21198

Closed eernstg closed 9 years ago

eernstg commented 9 years ago

It is a well-known and long lasting problem that the Javacript virtual machine representation of both int and double values is Javascript numbers (double). As a result, tests requiring a run-time distinction between those two types of variables will fail. This is not expected to change soon, and hence several requests have been made to the co19 team to test for a different pair of types whenever possible. Still, some tests are all about testing this distinction, and for them it does not make sense to test with a different pair of types. Hence, a small set of tests in this category will continue to fail for an unknown (and non-trivial) amount of time.

This ticket has been created as a kind of container for those tests: If/when the Javascript platform starts supporting the int/double distinction at run-time, success of these tests should be achieved, but until then we will ignore these tests, just marking them with the number of this issue in the status file.

DartBot commented 9 years ago

This comment was originally written by @Emasoft


Dart should advertise itself as featuring true distinction between int and doubles at runtime (if executed natively). This is one of the main advantages of Dart against Javascript. Of course tests should be aware of the context, and expecting the correct results only when Dart is run natively, not when compiled by dart2js.

eernstg commented 9 years ago

It turns out that the right place to handle this topic is 1533, where the topic has been discussed for quite a while. I'm closing this issue as a duplicate of issue #1533, please take the discussion there.


Added Duplicate label. Marked as being merged into #1533.