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 service_ref_element; | 5 library service_ref_element; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'package:logging/logging.dart'; | 8 import 'package:logging/logging.dart'; |
9 import 'package:polymer/polymer.dart'; | 9 import 'package:polymer/polymer.dart'; |
10 import 'observatory_element.dart'; | 10 import 'observatory_element.dart'; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 element.ref = ref; | 79 element.ref = ref; |
80 return element; | 80 return element; |
81 case 'Function': | 81 case 'Function': |
82 ServiceRefElement element = new Element.tag('function-ref'); | 82 ServiceRefElement element = new Element.tag('function-ref'); |
83 element.ref = ref; | 83 element.ref = ref; |
84 return element; | 84 return element; |
85 case 'Library': | 85 case 'Library': |
86 ServiceRefElement element = new Element.tag('library-ref'); | 86 ServiceRefElement element = new Element.tag('library-ref'); |
87 element.ref = ref; | 87 element.ref = ref; |
88 return element; | 88 return element; |
89 case 'Type': | |
90 case 'Array': | 89 case 'Array': |
| 90 case 'Bigint': |
91 case 'Bool': | 91 case 'Bool': |
92 case 'Closure': | 92 case 'Closure': |
93 case 'Double': | 93 case 'Double': |
94 case 'GrowableObjectArray': | 94 case 'GrowableObjectArray': |
95 case 'Instance': | 95 case 'Instance': |
| 96 case 'Mint': |
| 97 case 'Null': |
96 case 'Smi': | 98 case 'Smi': |
97 case 'Mint': | |
98 case 'Bigint': | |
99 case 'String': | 99 case 'String': |
| 100 case 'Type': |
100 ServiceRefElement element = new Element.tag('instance-ref'); | 101 ServiceRefElement element = new Element.tag('instance-ref'); |
101 element.ref = ref; | 102 element.ref = ref; |
102 return element; | 103 return element; |
103 default: | 104 default: |
104 SpanElement element = new Element.tag('span'); | 105 SpanElement element = new Element.tag('span'); |
105 element.text = "<<Unknown service ref: $ref>>"; | 106 element.text = "<<Unknown service ref: $ref>>"; |
106 return element; | 107 return element; |
107 } | 108 } |
108 } | 109 } |
109 | 110 |
110 refChanged(oldValue) { | 111 refChanged(oldValue) { |
111 // Remove the current view. | 112 // Remove the current view. |
112 children.clear(); | 113 children.clear(); |
113 if (ref == null) { | 114 if (ref == null) { |
114 Logger.root.info('Viewing null object.'); | 115 Logger.root.info('Viewing null object.'); |
115 return; | 116 return; |
116 } | 117 } |
117 var type = ref.serviceType; | 118 var type = ref.serviceType; |
118 var element = _constructElementForRef(); | 119 var element = _constructElementForRef(); |
119 if (element == null) { | 120 if (element == null) { |
120 Logger.root.info('Unable to find a ref element for \'${type}\''); | 121 Logger.root.info('Unable to find a ref element for \'${type}\''); |
121 return; | 122 return; |
122 } | 123 } |
123 children.add(element); | 124 children.add(element); |
124 Logger.root.info('Viewing object of \'${type}\''); | 125 Logger.root.info('Viewing object of \'${type}\''); |
125 } | 126 } |
126 } | 127 } |
OLD | NEW |