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 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/field_ref.dart'; | 9 import 'package:observatory/src/elements/field_ref.dart'; |
10 import 'package:observatory/src/elements/helpers/any_ref.dart'; | 10 import 'package:observatory/src/elements/helpers/any_ref.dart'; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) | 131 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) |
132 ..text = _instance.name | 132 ..text = _instance.name |
133 ]; | 133 ]; |
134 case M.InstanceKind.closure: | 134 case M.InstanceKind.closure: |
135 return [ | 135 return [ |
136 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) | 136 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) |
137 ..children = [ | 137 ..children = [ |
138 new SpanElement() | 138 new SpanElement() |
139 ..classes = ['emphasize'] | 139 ..classes = ['emphasize'] |
140 ..text = 'Closure', | 140 ..text = 'Closure', |
141 new SpanElement()..text = _instance.closureFunction.name | 141 new SpanElement()..text = ' (${_instance.closureFunction.name})' |
142 ] | 142 ] |
143 ]; | 143 ]; |
144 case M.InstanceKind.regExp: | 144 case M.InstanceKind.regExp: |
145 return [ | 145 return [ |
146 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) | 146 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) |
147 ..children = [ | 147 ..children = [ |
148 new SpanElement() | 148 new SpanElement() |
149 ..classes = ['emphasize'] | 149 ..classes = ['emphasize'] |
150 ..text = _instance.clazz.name, | 150 ..text = _instance.clazz.name, |
151 new SpanElement()..text = _instance.pattern.name | 151 new SpanElement()..text = ' (${_instance.pattern.valueAsString})' |
152 ] | 152 ] |
153 ]; | 153 ]; |
154 case M.InstanceKind.stackTrace: | 154 case M.InstanceKind.stackTrace: |
155 return [ | 155 return [ |
156 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) | 156 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) |
157 ..text = _instance.clazz.name, | 157 ..children = [ |
158 new CurlyBlockElement(queue: _r.queue) | 158 new SpanElement() |
159 ..content = [ | 159 ..classes = ['emphasize'] |
160 new DivElement() | 160 ..text = _instance.clazz.name, |
161 ..classes = ['stackTraceBox'] | |
162 ..text = _instance.valueAsString | |
163 ] | 161 ] |
164 ]; | 162 ]; |
165 case M.InstanceKind.plainInstance: | 163 case M.InstanceKind.plainInstance: |
166 return [ | 164 return [ |
167 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) | 165 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) |
168 ..classes = ['emphasize'] | 166 ..classes = ['emphasize'] |
169 ..text = _instance.clazz.name | 167 ..text = _instance.clazz.name |
170 ]; | 168 ]; |
171 case M.InstanceKind.list: | 169 case M.InstanceKind.list: |
172 case M.InstanceKind.map: | 170 case M.InstanceKind.map: |
(...skipping 26 matching lines...) Expand all Loading... |
199 ..classes = ['emphasize'] | 197 ..classes = ['emphasize'] |
200 ..text = _instance.clazz.name | 198 ..text = _instance.clazz.name |
201 ]; | 199 ]; |
202 case M.InstanceKind.weakProperty: | 200 case M.InstanceKind.weakProperty: |
203 return [ | 201 return [ |
204 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) | 202 new AnchorElement(href: Uris.inspect(_isolate, object: _instance)) |
205 ..classes = ['emphasize'] | 203 ..classes = ['emphasize'] |
206 ..text = _instance.clazz.name | 204 ..text = _instance.clazz.name |
207 ]; | 205 ]; |
208 } | 206 } |
209 throw new Exception('Unkown InstanceKind: ${_instance.kind}'); | 207 throw new Exception('Unknown InstanceKind: ${_instance.kind}'); |
210 } | 208 } |
211 | 209 |
212 bool _hasValue() { | 210 bool _hasValue() { |
213 switch (_instance.kind) { | 211 switch (_instance.kind) { |
214 case M.InstanceKind.plainInstance: | 212 case M.InstanceKind.plainInstance: |
215 case M.InstanceKind.mirrorReference: | 213 case M.InstanceKind.mirrorReference: |
| 214 case M.InstanceKind.stackTrace: |
216 case M.InstanceKind.weakProperty: | 215 case M.InstanceKind.weakProperty: |
217 return true; | 216 return true; |
218 case M.InstanceKind.list: | 217 case M.InstanceKind.list: |
219 case M.InstanceKind.map: | 218 case M.InstanceKind.map: |
220 case M.InstanceKind.uint8ClampedList: | 219 case M.InstanceKind.uint8ClampedList: |
221 case M.InstanceKind.uint8List: | 220 case M.InstanceKind.uint8List: |
222 case M.InstanceKind.uint16List: | 221 case M.InstanceKind.uint16List: |
223 case M.InstanceKind.uint32List: | 222 case M.InstanceKind.uint32List: |
224 case M.InstanceKind.uint64List: | 223 case M.InstanceKind.uint64List: |
225 case M.InstanceKind.int8List: | 224 case M.InstanceKind.int8List: |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 return _loadedInstance.typedElements | 290 return _loadedInstance.typedElements |
292 .map((e) => new DivElement()..text = '[ ${index++} ] : $e') | 291 .map((e) => new DivElement()..text = '[ ${index++} ] : $e') |
293 .toList() | 292 .toList() |
294 ..addAll(_createShowMoreButton()); | 293 ..addAll(_createShowMoreButton()); |
295 case M.InstanceKind.mirrorReference: | 294 case M.InstanceKind.mirrorReference: |
296 return [ | 295 return [ |
297 new SpanElement()..text = '<referent> : ', | 296 new SpanElement()..text = '<referent> : ', |
298 new InstanceRefElement(_isolate, _loadedInstance.referent, _instances, | 297 new InstanceRefElement(_isolate, _loadedInstance.referent, _instances, |
299 queue: _r.queue) | 298 queue: _r.queue) |
300 ]; | 299 ]; |
| 300 case M.InstanceKind.stackTrace: |
| 301 return [ |
| 302 new DivElement() |
| 303 ..classes = ['stackTraceBox'] |
| 304 ..text = _instance.valueAsString |
| 305 ]; |
301 case M.InstanceKind.weakProperty: | 306 case M.InstanceKind.weakProperty: |
302 return [ | 307 return [ |
303 new SpanElement()..text = '<key> : ', | 308 new SpanElement()..text = '<key> : ', |
304 new InstanceRefElement(_isolate, _loadedInstance.key, _instances, | 309 new InstanceRefElement(_isolate, _loadedInstance.key, _instances, |
305 queue: _r.queue), | 310 queue: _r.queue), |
306 new BRElement(), | 311 new BRElement(), |
307 new SpanElement()..text = '<value> : ', | 312 new SpanElement()..text = '<value> : ', |
308 new InstanceRefElement(_isolate, _loadedInstance.value, _instances, | 313 new InstanceRefElement(_isolate, _loadedInstance.value, _instances, |
309 queue: _r.queue), | 314 queue: _r.queue), |
310 ]; | 315 ]; |
311 default: | 316 default: |
312 return []; | 317 return []; |
313 } | 318 } |
314 } | 319 } |
315 } | 320 } |
OLD | NEW |