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

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

Issue 11748016: Make ~/, round, ceil, floor, truncate return ints. Remove toInt. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Checked mode fixes. Created 7 years, 12 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 b36c71cf2721393860254555d2f6017de279d763..917afcc4ae34f3839e53c2ad814f2ae64be30205 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
@@ -200,7 +200,7 @@ class JavaScriptConstantSystem implements 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);
}

Powered by Google App Engine
This is Rietveld 408576698