Chromium Code Reviews| Index: pkg/kernel/lib/ast.dart |
| diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart |
| index fa2d18086786c490994e0d73ab078909a8e60dbc..fa54b37a3134684285872758a6553466c001453c 100644 |
| --- a/pkg/kernel/lib/ast.dart |
| +++ b/pkg/kernel/lib/ast.dart |
| @@ -4371,7 +4371,7 @@ class Source { |
| /// Return the text corresponding to [line] which is a 1-based line |
| /// number. The returned line contains no line separators. |
| String getTextLine(int line) { |
| - _rangeCheck(line, 1, lineStarts.length, "line"); |
| + RangeError.checkValueInInterval(line, 1, lineStarts.length, 'line'); |
|
ahe
2017/05/05 05:27:44
Did you change the error message produced by Range
sra1
2017/05/05 05:49:01
No. I also think the RangeError description is con
ahe
2017/05/08 10:25:21
I'm surprised that this change was submitted altho
|
| if (source == null) return null; |
| cachedText ??= UTF8.decode(source, allowMalformed: true); |
| @@ -4396,7 +4396,7 @@ class Source { |
| /// Translates an offset to line and column numbers in the given file. |
| Location getLocation(String file, int offset) { |
| - _rangeCheck(offset, 0, lineStarts.last, "offset"); |
| + RangeError.checkValueInInterval(offset, 0, lineStarts.last, 'offset'); |
| int low = 0, high = lineStarts.length - 1; |
| while (low < high) { |
| int mid = high - ((high - low) >> 1); // Get middle, rounding up. |
| @@ -4415,11 +4415,6 @@ class Source { |
| } |
| } |
| -void _rangeCheck(int value, int min, int max, String name) { |
| - RangeError.checkValueInInterval(value, min, max, name, |
| - "The value of '$name' ($value) must be between $min and $max."); |
| -} |
| - |
| /// Returns the [Reference] object for the given member. |
| /// |
| /// Returns `null` if the member is `null`. |