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

Unified Diff: pkg/kernel/lib/ast.dart

Issue 2864573002: dart2js allocation tweaks (Closed)
Patch Set: Created 3 years, 7 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 | « pkg/compiler/lib/src/world.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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`.
« no previous file with comments | « pkg/compiler/lib/src/world.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698