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

Unified Diff: sdk/lib/_internal/compiler/implementation/constant_system_dart.dart

Issue 11773026: Update co19 status files and some small fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | sdk/lib/core/iterable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/constant_system_dart.dart
diff --git a/sdk/lib/_internal/compiler/implementation/constant_system_dart.dart b/sdk/lib/_internal/compiler/implementation/constant_system_dart.dart
index 7899d177860f6cfb82b23efa703dc841735b3644..75dce33b1fe28438fd3cf1849e6d9515e91c8be1 100644
--- a/sdk/lib/_internal/compiler/implementation/constant_system_dart.dart
+++ b/sdk/lib/_internal/compiler/implementation/constant_system_dart.dart
@@ -207,7 +207,11 @@ class TruncatingDivideOperation extends ArithmeticNumOperation {
if (right == 0) return null;
return left ~/ right;
}
- num foldNums(num left, num right) => left ~/ right;
+ num foldNums(num left, num right) {
+ num ratio = left / right;
+ if (ratio.isNaN || ratio.isInfinite) return null;
+ return ratio.truncate().toInt();
+ }
apply(left, right) => left ~/ right;
}
« no previous file with comments | « no previous file | sdk/lib/core/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698