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

Unified Diff: runtime/lib/integers.dart

Issue 10937011: Bug cleanup: unify on allowing radices from 2 to 36 in (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. 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 | « lib/core/num.dart ('k') | tests/corelib/integer_to_radix_string_test.dart » ('j') | 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 09a3f689944c5aa50f5b775696db928a8cf392e3..14ed12301620e6b1229ed343d5c6c1193ed97753 100644
--- a/runtime/lib/integers.dart
+++ b/runtime/lib/integers.dart
@@ -154,9 +154,11 @@ class _IntegerImplementation {
}
String toRadixString(int radix) {
final table = const ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
- "a", "b", "c", "d", "e", "f"];
- if ((radix <= 1) || (radix > 16)) {
- throw "Bad radix: $radix";
+ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
+ "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
+ "u", "v", "w", "x", "y", "z"];
+ if (radix < 2 || radix > 36) {
+ throw new IllegalArgumentException(radix);
}
final bool isNegative = this < 0;
var value = isNegative ? -this : this;
« no previous file with comments | « lib/core/num.dart ('k') | tests/corelib/integer_to_radix_string_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698