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

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

Issue 1960213002: Skip adding line based range data for ranges that don't map to a line. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1b94f3837f25e9c73f6a81e062f9029af9c48032..0843a398a9568641187d3a9878d2fdefe64c2f21 100644
--- a/runtime/observatory/lib/src/elements/script_inset.dart
+++ b/runtime/observatory/lib/src/elements/script_inset.dart
@@ -597,12 +597,14 @@ class ScriptInsetElement extends ObservatoryElement {
for (var range in sourceReport['ranges']) {
int startLine = script.tokenToLine(range['startPos']);
int endLine = script.tokenToLine(range['endPos']);
- for (var line = startLine; line <= endLine; line++) {
- var rangeList = _rangeMap[line];
- if (rangeList == null) {
- _rangeMap[line] = [range];
- } else {
- rangeList.add(range);
+ if ((startLine != null) && (endLine != null)) {
turnidge 2016/05/09 19:20:12 Can you add a TODO(turnidge) here to track down th
Cutch 2016/05/09 20:40:04 Done.
+ for (var line = startLine; line <= endLine; line++) {
+ var rangeList = _rangeMap[line];
+ if (rangeList == null) {
+ _rangeMap[line] = [range];
+ } else {
+ rangeList.add(range);
+ }
}
}
if (_includeProfile && range['profile'] != null) {
« 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