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

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

Issue 1212933003: Observatory improvements for exploring compiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 791534fdfbd3e32b4221cc08ffe260251626827e..66b125caa62926df5f17d04278a80a9b723f9f9f 100644
--- a/runtime/observatory/lib/src/elements/script_inset.dart
+++ b/runtime/observatory/lib/src/elements/script_inset.dart
@@ -439,8 +439,12 @@ class ScriptInsetElement extends ObservatoryElement {
? script.tokenToLine(currentPos)
: null);
_currentCol = (currentPos != null
- ? (script.tokenToCol(currentPos) - 1) // make this 0-based.
+ ? (script.tokenToCol(currentPos))
: null);
+ if (_currentCol != null) {
+ _currentCol--; // make this 0-based.
+ }
+
_endLine = (endPos != null
? script.tokenToLine(endPos)
: script.lines.length + script.lineOffset);
@@ -564,6 +568,10 @@ class ScriptInsetElement extends ObservatoryElement {
var table = new DivElement();
table.classes.add("sourceTable");
+ if (_startLine == null || _endLine == null) {
+ return table;
+ }
+
annotationsCursor = 0;
int blankLineCount = 0;
« no previous file with comments | « runtime/observatory/lib/src/elements/objectpool_view.html ('k') | runtime/observatory/lib/src/elements/service_ref.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698