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

Unified Diff: pkg/fixnum/lib/src/int32.dart

Issue 21155004: Clean up exceptions thrown in pkg/fixnum. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to pick up fixnum class renames. Created 7 years, 5 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 | pkg/fixnum/lib/src/int64.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fixnum/lib/src/int32.dart
diff --git a/pkg/fixnum/lib/src/int32.dart b/pkg/fixnum/lib/src/int32.dart
index 1e139d2478224e407cb371b45a1fe3b1859cc2a1..c1da15bc524c855465469d96bc52c7abd567b45f 100644
--- a/pkg/fixnum/lib/src/int32.dart
+++ b/pkg/fixnum/lib/src/int32.dart
@@ -64,7 +64,7 @@ class Int32 implements IntX {
// TODO(rice) - Make this faster by converting several digits at once.
static Int32 parseRadix(String s, int radix) {
if ((radix <= 1) || (radix > 16)) {
- throw "Bad radix: $radix";
+ throw new ArgumentError("Bad radix: $radix");
}
Int32 x = ZERO;
for (int i = 0; i < s.length; i++) {
@@ -235,7 +235,7 @@ class Int32 implements IntX {
Int32 operator <<(int n) {
if (n < 0) {
- throw new ArgumentError("$n");
+ throw new ArgumentError(n);
}
n &= 31;
return new Int32.fromInt(_i << n);
@@ -243,7 +243,7 @@ class Int32 implements IntX {
Int32 operator >>(int n) {
if (n < 0) {
- throw new ArgumentError("$n");
+ throw new ArgumentError(n);
}
n &= 31;
int value;
@@ -257,7 +257,7 @@ class Int32 implements IntX {
Int32 shiftRightUnsigned(int n) {
if (n < 0) {
- throw new ArgumentError("$n");
+ throw new ArgumentError(n);
}
n &= 31;
int value;
« no previous file with comments | « no previous file | pkg/fixnum/lib/src/int64.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698