Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/constant_system_javascript.dart

Issue 12317107: ceil/floor/truncate/round return integers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload due to error3 Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/js_backend/constant_system_javascript.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/constant_system_javascript.dart b/sdk/lib/_internal/compiler/implementation/js_backend/constant_system_javascript.dart
index fa5384f22ffcd4aeb72026b25dda1cadf14441c7..1b4a0ffd81d0c3bd9cc707bcec148241bb194684 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/constant_system_javascript.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/constant_system_javascript.dart
@@ -199,7 +199,7 @@ class JavaScriptConstantSystem extends ConstantSystem {
double doubleValue = doubleResult.value;
if (!doubleValue.isInfinite && !doubleValue.isNaN &&
!constant.isMinusZero()) {
- int intValue = doubleValue.toInt();
+ int intValue = doubleValue.truncate();
if (intValue == doubleValue && integerFitsIntoDouble(intValue)) {
return new IntConstant(intValue);
}
« no previous file with comments | « samples/third_party/dromaeo/common/Math2.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/js_number.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698