| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library script_inset_element; | 5 library script_inset_element; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'observatory_element.dart'; | 9 import 'observatory_element.dart'; |
| 10 import 'service_ref.dart'; | 10 import 'service_ref.dart'; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 element.title = "Current execution"; | 114 element.title = "Current execution"; |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 class BreakpointAnnotation extends Annotation { | 118 class BreakpointAnnotation extends Annotation { |
| 119 Breakpoint bpt; | 119 Breakpoint bpt; |
| 120 int priority = 1; | 120 int priority = 1; |
| 121 | 121 |
| 122 BreakpointAnnotation(this.bpt) { | 122 BreakpointAnnotation(this.bpt) { |
| 123 var script = bpt.location.script; | 123 var script = bpt.location.script; |
| 124 if (bpt.location.tokenPos != null) { | 124 var location = bpt.location; |
| 125 var pos = bpt.location.tokenPos; | 125 if (location.tokenPos != null) { |
| 126 var pos = location.tokenPos; |
| 126 line = script.tokenToLine(pos); | 127 line = script.tokenToLine(pos); |
| 127 columnStart = script.tokenToCol(pos) - 1; // tokenToCol is 1-origin. | 128 columnStart = script.tokenToCol(pos) - 1; // tokenToCol is 1-origin. |
| 128 } else { | 129 } else if (location is UnresolvedSourceLocation) { |
| 129 line = bpt.location.line; | 130 line = location.line; |
| 130 columnStart = bpt.location.column; | 131 columnStart = location.column; |
| 131 if (columnStart == null) { | 132 if (columnStart == null) { |
| 132 columnStart = 0; | 133 columnStart = 0; |
| 133 } | 134 } |
| 134 } | 135 } |
| 135 var length = script.guessTokenLength(line, columnStart); | 136 var length = script.guessTokenLength(line, columnStart); |
| 136 if (length == null) { | 137 if (length == null) { |
| 137 length = 1; | 138 length = 1; |
| 138 } | 139 } |
| 139 columnStop = columnStart + length; | 140 columnStop = columnStart + length; |
| 140 } | 141 } |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 @CustomTag('source-inset') | 1013 @CustomTag('source-inset') |
| 1013 class SourceInsetElement extends PolymerElement { | 1014 class SourceInsetElement extends PolymerElement { |
| 1014 SourceInsetElement.created() : super.created(); | 1015 SourceInsetElement.created() : super.created(); |
| 1015 | 1016 |
| 1016 @published SourceLocation location; | 1017 @published SourceLocation location; |
| 1017 @published String height = null; | 1018 @published String height = null; |
| 1018 @published int currentPos; | 1019 @published int currentPos; |
| 1019 @published bool inDebuggerContext = false; | 1020 @published bool inDebuggerContext = false; |
| 1020 @published ObservableList variables; | 1021 @published ObservableList variables; |
| 1021 } | 1022 } |
| 1022 | |
| OLD | NEW |