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

Unified Diff: runtime/lib/integers.dart

Issue 10912066: Don't throw on 1 ~/ 0.0. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/integers.dart
diff --git a/runtime/lib/integers.dart b/runtime/lib/integers.dart
index f9f2014628973005f203ff61cb26d8d8d0770403..90a7f751b676f64b74017686fca114864b3faf61 100644
--- a/runtime/lib/integers.dart
+++ b/runtime/lib/integers.dart
@@ -19,7 +19,7 @@ class IntegerImplementation {
return other.mulFromInteger(this);
}
num operator ~/(num other) {
- if (other == 0) {
+ if ((other is int) && (other == 0)) {
throw const IntegerDivisionByZeroException();
}
return other.truncDivFromInteger(this);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698