Index: runtime/lib/integers.dart |
diff --git a/runtime/lib/integers.dart b/runtime/lib/integers.dart |
index a103f23872837cd41f31e826acc10c6a75a835e6..a7722b06b30d7290d45e957e9cabbca60dccfe23 100644 |
--- a/runtime/lib/integers.dart |
+++ b/runtime/lib/integers.dart |
@@ -174,22 +174,21 @@ abstract class _IntegerImplementation { |
num clamp(num lowerLimit, num upperLimit) { |
if (lowerLimit is! num) { |
- throw new ArgumentError.value(lowerLimit, "lowerLimit"); |
+ throw new ArgumentError.value(lowerLimit, "lowerLimit", "not a number"); |
} |
if (upperLimit is! num) { |
- throw new ArgumentError.value(upperLimit, "upperLimit"); |
+ throw new ArgumentError.value(upperLimit, "upperLimit", "not a number"); |
} |
// Special case for integers. |
- if (lowerLimit is int && upperLimit is int && |
- lowerLimit <= upperLimit) { |
+ if (lowerLimit is int && upperLimit is int && lowerLimit <= upperLimit) { |
if (this < lowerLimit) return lowerLimit; |
if (this > upperLimit) return upperLimit; |
return this; |
} |
// Generic case involving doubles, and invalid integer ranges. |
if (lowerLimit.compareTo(upperLimit) > 0) { |
- throw new RangeError.range(upperLimit, lowerLimit, null, "upperLimit"); |
+ throw new ArgumentError(lowerLimit); |
} |
if (lowerLimit.isNaN) return lowerLimit; |
// Note that we don't need to care for -0.0 for the lower limit. |