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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 script.load().then((_) { | 57 script.load().then((_) { |
58 if (script.loaded) { | 58 if (script.loaded) { |
59 _updateProperties(); | 59 _updateProperties(); |
60 } | 60 } |
61 }); | 61 }); |
62 return; | 62 return; |
63 } | 63 } |
64 notifyPropertyChange(#lines, 0, 1); | 64 notifyPropertyChange(#lines, 0, 1); |
65 lines.clear(); | 65 lines.clear(); |
66 var startLineNumber = script.tokenToLine(pos); | 66 var startLineNumber = script.tokenToLine(pos); |
67 if (endPos == null) { | 67 if (startLineNumber != null) { |
68 lines.add(script.lines[startLineNumber - 1]); | 68 if (endPos == null) { |
69 } else { | 69 lines.add(script.lines[startLineNumber - 1]); |
70 var endLineNumber = script.tokenToLine(endPos); | 70 } else { |
71 assert(endLineNumber != null); | 71 var endLineNumber = script.tokenToLine(endPos); |
72 for (var i = startLineNumber; i <= endLineNumber; i++) { | 72 assert(endLineNumber != null); |
73 lines.add(script.lines[i - 1]); | 73 for (var i = startLineNumber; i <= endLineNumber; i++) { |
| 74 lines.add(script.lines[i - 1]); |
| 75 } |
74 } | 76 } |
75 } | 77 } |
76 } | 78 } |
77 | 79 |
78 ScriptInsetElement.created() : super.created(); | 80 ScriptInsetElement.created() : super.created(); |
79 } | 81 } |
OLD | NEW |