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

Unified Diff: runtime/observatory/lib/src/elements/script_inset.dart

Issue 1101083003: Fixes to enable building dart io implementation in mojo tree (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
Index: runtime/observatory/lib/src/elements/script_inset.dart
diff --git a/runtime/observatory/lib/src/elements/script_inset.dart b/runtime/observatory/lib/src/elements/script_inset.dart
index cdbd077c649444c04e6b99bb019e8445fc8a177f..1c158c0835c4236841d26b36d3908f93cad94679 100644
--- a/runtime/observatory/lib/src/elements/script_inset.dart
+++ b/runtime/observatory/lib/src/elements/script_inset.dart
@@ -335,7 +335,7 @@ class ScriptInsetElement extends ObservatoryElement {
void computeAnnotations() {
_startLine = (startPos != null
? script.tokenToLine(startPos)
- : 1);
+ : 1 + script.lineOffset);
_currentLine = (currentPos != null
? script.tokenToLine(currentPos)
: null);
@@ -344,7 +344,7 @@ class ScriptInsetElement extends ObservatoryElement {
: null);
_endLine = (endPos != null
? script.tokenToLine(endPos)
- : script.lines.length);
+ : script.lines.length + script.lineOffset);
annotations.clear();
if (_currentLine != null) {
@@ -386,8 +386,9 @@ class ScriptInsetElement extends ObservatoryElement {
annotationsCursor = 0;
int blankLineCount = 0;
- for (int i = (_startLine - 1); i <= (_endLine - 1); i++) {
- if (script.lines[i].isBlank) {
+ for (int i = _startLine; i <= _endLine; i++) {
+ var line = script.getLine(i);
+ if (line.isBlank) {
// Try to introduce elipses if there are 4 or more contiguous
// blank lines.
blankLineCount++;
@@ -398,17 +399,17 @@ class ScriptInsetElement extends ObservatoryElement {
if (blankLineCount < 4) {
// Too few blank lines for an elipsis.
for (int j = firstBlank; j <= lastBlank; j++) {
- table.append(lineElement(script.lines[j]));
+ table.append(lineElement(script.getLine(j)));
}
} else {
// Add an elipsis for the skipped region.
- table.append(lineElement(script.lines[firstBlank]));
+ table.append(lineElement(script.getLine(firstBlank)));
table.append(lineElement(null));
- table.append(lineElement(script.lines[lastBlank]));
+ table.append(lineElement(script.getLine(lastBlank)));
}
blankLineCount = 0;
}
- table.append(lineElement(script.lines[i]));
+ table.append(lineElement(line));
}
}

Powered by Google App Engine
This is Rietveld 408576698