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

Unified Diff: pkg/analyzer/lib/src/generated/source.dart

Issue 1457313003: Add back a utility method needed by tests (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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: pkg/analyzer/lib/src/generated/source.dart
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index 24fec623ea748adab62aba90c34383d566fd6c2a..79cd48f37bcc63620413f00a8c0a2e4ae3ded7ae 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -208,17 +208,6 @@ class LineInfo {
}
}
-// /**
-// * Return the offset of the first character on the line with the given
-// * [lineNumber].
-// */
-// int getLineOffset(int lineNumber) {
-// if (lineNumber < 0 || lineNumber >= _lineStarts.length) {
-// throw new ArgumentError('Invalid line number: $lineNumber');
-// }
-// return _lineStarts[lineNumber];
-// }
-
/**
* Return the location information for the character at the given offset.
*
@@ -258,6 +247,17 @@ class LineInfo {
return new LineInfo_Location(min + 1, offset - _lineStarts[min] + 1);
}
+
+ /**
+ * Return the offset of the first character on the line with the given
+ * [lineNumber].
+ */
+ int getOffsetOfLine(int lineNumber) {
+ if (lineNumber < 0 || lineNumber >= _lineStarts.length) {
+ throw new ArgumentError('Invalid line number: $lineNumber');
+ }
+ return _lineStarts[lineNumber];
+ }
}
/**
« 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