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 instance_ref_element; | 5 library instance_ref_element; |
6 | 6 |
7 import 'package:polymer/polymer.dart'; | 7 import 'package:polymer/polymer.dart'; |
8 import 'package:observatory/service.dart'; | 8 import 'package:observatory/service.dart'; |
9 import 'service_ref.dart'; | 9 import 'service_ref.dart'; |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 return super.hoverText; | 31 return super.hoverText; |
32 } | 32 } |
33 | 33 |
34 // TODO(turnidge): This is here to workaround vm/dart2js differences. | 34 // TODO(turnidge): This is here to workaround vm/dart2js differences. |
35 dynamic expander() { | 35 dynamic expander() { |
36 return expandEvent; | 36 return expandEvent; |
37 } | 37 } |
38 | 38 |
39 void expandEvent(bool expand, var done) { | 39 void expandEvent(bool expand, var done) { |
40 assert(ref is ServiceMap); | 40 assert(ref is Instance); |
41 if (expand) { | 41 if (expand) { |
42 ref.reload().then((result) { | 42 ref.reload().then((result) { |
43 if (result['valueAsString'] != null) { | 43 if (result.valueAsString != null) { |
44 result.name = result['valueAsString']; | 44 result.name = result.valueAsString; |
45 result.vmName = result['valueAsString']; | 45 result.vmName = result.valueAsString; |
46 } | 46 } |
47 ref = result; | 47 ref = result; |
48 notifyPropertyChange(#ref, 0, 1); | 48 notifyPropertyChange(#ref, 0, 1); |
49 }).whenComplete(done); | 49 }).whenComplete(done); |
50 } else { | 50 } else { |
51 ServiceMap refMap = ref; | 51 Instance refMap = ref; |
52 refMap['fields'] = null; | 52 refMap.fields = null; |
53 refMap['elements'] = null; | 53 refMap.elements = null; |
54 done(); | 54 done(); |
55 } | 55 } |
56 } | 56 } |
57 } | 57 } |
OLD | NEW |