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 'observatory_element.dart'; | 7 import 'observatory_element.dart'; |
8 import 'package:observatory/service.dart'; | 8 import 'package:observatory/service.dart'; |
9 import 'package:polymer/polymer.dart'; | 9 import 'package:polymer/polymer.dart'; |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 if (script.loaded) { | 65 if (script.loaded) { |
66 _updateFuture = null; | 66 _updateFuture = null; |
67 _updateLines(); | 67 _updateLines(); |
68 } | 68 } |
69 }); | 69 }); |
70 return; | 70 return; |
71 } | 71 } |
72 startLine = | 72 startLine = |
73 (pos != null) ? script.tokenToLine(pos) - 1 : 0; | 73 (pos != null) ? script.tokenToLine(pos) - 1 : 0; |
74 endLine = | 74 endLine = |
75 (endPos != null) ? script.tokenToLine(endPos) : script.lines.length; | 75 (endPos != null) ? script.tokenToLine(endPos) : startLine + 1; |
76 // Add line numbers. | 76 // Add line numbers. |
77 lineNumbers.clear(); | 77 lineNumbers.clear(); |
78 for (var i = startLine; i < endLine; i++) { | 78 for (var i = startLine; i < endLine; i++) { |
79 lineNumbers.add(i); | 79 lineNumbers.add(i); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 ScriptInsetElement.created() : super.created(); | 83 ScriptInsetElement.created() : super.created(); |
84 } | 84 } |
OLD | NEW |