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

Unified Diff: sdk/lib/core/errors.dart

Issue 717823002: Manually default Error messages to avoid dart2js code bloat. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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: sdk/lib/core/errors.dart
diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart
index f4509eb774968ed67531c05c56d03ee31c75ab07..75cac23585cf7f25dc540c39f663a650a93e3062 100644
--- a/sdk/lib/core/errors.dart
+++ b/sdk/lib/core/errors.dart
@@ -243,9 +243,9 @@ class RangeError extends ArgumentError {
: invalidValue = null, start = null, end = null, super(message);
/** Create a new [RangeError] with a message for the given [value]. */
- RangeError.value(num value, [String message = "Value not in range"])
+ RangeError.value(num value, [String message])
: invalidValue = value, start = null, end = null,
- super(message);
+ super(message != null ? message : "Value not in range");
/**
* Create a new [RangeError] with for an invalid value being outside a range.
@@ -256,8 +256,8 @@ class RangeError extends ArgumentError {
* For a range from 0 to the length of something, end exclusive, use
* [RangeError.index].
*/
- RangeError.range(this.invalidValue, this.start, this.end,
- [String message = "Invalid value"]) : super(message);
+ RangeError.range(this.invalidValue, this.start, this.end, [String message])
+ : super(message != null ? message : "Invalid value");
/**
* Creates a new [RangeError] stating that [index] is not a valid index
@@ -317,11 +317,10 @@ class IndexError extends ArgumentError implements RangeError {
*
* The message is used as part of the string representation of the error.
*/
- IndexError(this.invalidValue, indexable,
- [String message = "Index out of range", int length])
+ IndexError(this.invalidValue, indexable, [String message, int length])
: this.indexable = indexable,
this.length = (length != null) ? length : indexable.length,
- super(message);
+ super(message != null ? message : "Index out of range");
// Getters inherited from RangeError.
int get start => 0;
« 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