| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:html'; | 5 import 'dart:html'; |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import 'package:observatory/models.dart' as M; | 7 import 'package:observatory/models.dart' as M; |
| 8 import 'package:observatory/src/elements/curly_block.dart'; | 8 import 'package:observatory/src/elements/curly_block.dart'; |
| 9 import 'package:observatory/src/elements/instance_ref.dart'; | 9 import 'package:observatory/src/elements/instance_ref.dart'; |
| 10 import 'package:observatory/src/elements/helpers/any_ref.dart'; | 10 import 'package:observatory/src/elements/helpers/any_ref.dart'; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 ]; | 92 ]; |
| 93 } | 93 } |
| 94 return _path.elements.map(_createItem).toList(); | 94 return _path.elements.map(_createItem).toList(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 Element _createItem(M.RetainingPathItem item) { | 97 Element _createItem(M.RetainingPathItem item) { |
| 98 final content = <Element>[]; | 98 final content = <Element>[]; |
| 99 | 99 |
| 100 if (item.parentField != null) { | 100 if (item.parentField != null) { |
| 101 content.add( | 101 content.add( |
| 102 new DivElement() | 102 new SpanElement() |
| 103 ..children = [ | 103 ..children = [ |
| 104 new SpanElement()..text = 'from ', | 104 new SpanElement()..text = 'from ', |
| 105 new InstanceRefElement(_isolate, item.parentField, _instances, | 105 anyRef(_isolate, item.parentField, _instances, queue: _r.queue), |
| 106 queue: _r.queue), | |
| 107 new SpanElement()..text = ' of ', | 106 new SpanElement()..text = ' of ', |
| 108 ]); | 107 ]); |
| 109 } else if (item.parentListIndex != null) { | 108 } else if (item.parentListIndex != null) { |
| 110 content.add( | 109 content.add( |
| 111 new SpanElement() | 110 new SpanElement() |
| 112 ..text = 'from [ ${item.parentListIndex} ] of '); | 111 ..text = 'from [ ${item.parentListIndex} ] of '); |
| 113 } else if (item.parentWordOffset != null) { | 112 } else if (item.parentWordOffset != null) { |
| 114 content.add( | 113 content.add( |
| 115 new SpanElement() | 114 new SpanElement() |
| 116 ..text = 'from word [ ${item.parentWordOffset} ] of '); | 115 ..text = 'from word [ ${item.parentWordOffset} ] of '); |
| 117 } else { | 116 } else { |
| 118 content.add(new SpanElement()..text = 'from '); | 117 content.add(new SpanElement()..text = 'from '); |
| 119 } | 118 } |
| 120 | 119 |
| 121 content.add( | 120 content.add( |
| 122 anyRef(_isolate, item.source, _instances, queue: _r.queue) | 121 anyRef(_isolate, item.source, _instances, queue: _r.queue) |
| 123 ); | 122 ); |
| 124 | 123 |
| 125 return new DivElement()..classes = ['indent']..children = content; | 124 return new DivElement()..classes = ['indent']..children = content; |
| 126 } | 125 } |
| 127 } | 126 } |
| OLD | NEW |