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 'package:observatory/models.dart' as M; | 6 import 'package:observatory/models.dart' as M; |
7 import 'package:observatory/src/elements/class_ref.dart'; | 7 import 'package:observatory/src/elements/class_ref.dart'; |
8 import 'package:observatory/src/elements/code_ref.dart'; | 8 import 'package:observatory/src/elements/code_ref.dart'; |
9 import 'package:observatory/src/elements/context_ref.dart'; | 9 import 'package:observatory/src/elements/context_ref.dart'; |
10 import 'package:observatory/src/elements/error_ref.dart'; | 10 import 'package:observatory/src/elements/error_ref.dart'; |
(...skipping 10 matching lines...) Expand all Loading... |
21 import 'package:observatory/src/elements/pc_descriptors_ref.dart'; | 21 import 'package:observatory/src/elements/pc_descriptors_ref.dart'; |
22 import 'package:observatory/src/elements/script_ref.dart'; | 22 import 'package:observatory/src/elements/script_ref.dart'; |
23 import 'package:observatory/src/elements/sentinel_value.dart'; | 23 import 'package:observatory/src/elements/sentinel_value.dart'; |
24 import 'package:observatory/src/elements/type_arguments_ref.dart'; | 24 import 'package:observatory/src/elements/type_arguments_ref.dart'; |
25 import 'package:observatory/src/elements/token_stream_ref.dart'; | 25 import 'package:observatory/src/elements/token_stream_ref.dart'; |
26 import 'package:observatory/src/elements/unknown_ref.dart'; | 26 import 'package:observatory/src/elements/unknown_ref.dart'; |
27 | 27 |
28 Element anyRef(M.IsolateRef isolate, ref, | 28 Element anyRef(M.IsolateRef isolate, ref, |
29 M.InstanceRepository instances, {RenderingQueue queue}) { | 29 M.InstanceRepository instances, {RenderingQueue queue}) { |
30 if (ref is M.Guarded) { | 30 if (ref is M.Guarded) { |
31 return anyRef(isolate, ref.asSentinel ?? ref.asValue, instances, | 31 if (ref.isSentinel) { |
32 queue: queue); | 32 return anyRef(isolate, ref.asSentinel, instances, queue: queue); |
| 33 } else { |
| 34 return anyRef(isolate, ref.asValue, instances, queue: queue); |
| 35 } |
33 } else if (ref is M.ObjectRef) { | 36 } else if (ref is M.ObjectRef) { |
34 if (ref is M.ClassRef) { | 37 if (ref is M.ClassRef) { |
35 return new ClassRefElement(isolate, ref, queue: queue); | 38 return new ClassRefElement(isolate, ref, queue: queue); |
36 } else if (ref is M.CodeRef) { | 39 } else if (ref is M.CodeRef) { |
37 return new CodeRefElement(isolate, ref, queue: queue); | 40 return new CodeRefElement(isolate, ref, queue: queue); |
38 } else if (ref is M.ContextRef) { | 41 } else if (ref is M.ContextRef) { |
39 return new ContextRefElement(isolate, ref, queue: queue); | 42 return new ContextRefElement(isolate, ref, queue: queue); |
40 } else if (ref is M.Error ) { | 43 } else if (ref is M.Error ) { |
41 return new ErrorRefElement(ref, queue: queue); | 44 return new ErrorRefElement(ref, queue: queue); |
42 } else if (ref is M.FieldRef) { | 45 } else if (ref is M.FieldRef) { |
(...skipping 22 matching lines...) Expand all Loading... |
65 return new TokenStreamRefElement(isolate, ref, queue: queue); | 68 return new TokenStreamRefElement(isolate, ref, queue: queue); |
66 } else if (ref is M.UnknownObjectRef) { | 69 } else if (ref is M.UnknownObjectRef) { |
67 return new UnknownObjectRefElement(isolate, ref, queue: queue); | 70 return new UnknownObjectRefElement(isolate, ref, queue: queue); |
68 } else { | 71 } else { |
69 return new AnchorElement(href: Uris.inspect(isolate, object: ref)) | 72 return new AnchorElement(href: Uris.inspect(isolate, object: ref)) |
70 ..text = 'object'; | 73 ..text = 'object'; |
71 } | 74 } |
72 } else if (ref is M.Sentinel) { | 75 } else if (ref is M.Sentinel) { |
73 return new SentinelValueElement(ref, queue: queue); | 76 return new SentinelValueElement(ref, queue: queue); |
74 } | 77 } |
75 throw new Exception('Unknown runtimeType (${ref.runtimeType})'); | 78 throw new Exception('Unknown ref type (${ref.runtimeType})'); |
76 } | 79 } |
OLD | NEW |