Chromium Code Reviews| 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:logging/logging.dart'; | 7 import 'package:logging/logging.dart'; |
| 8 import 'package:polymer/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
| 9 import 'service_ref.dart'; | 9 import 'service_ref.dart'; |
| 10 | 10 |
| 11 @CustomTag('instance-ref') | 11 @CustomTag('instance-ref') |
| 12 class InstanceRefElement extends ServiceRefElement { | 12 class InstanceRefElement extends ServiceRefElement { |
| 13 InstanceRefElement.created() : super.created(); | 13 InstanceRefElement.created() : super.created(); |
| 14 | 14 |
| 15 String get name { | 15 String get name { |
| 16 if (ref == null) { | 16 if (ref == null) { |
| 17 return super.name; | 17 return super.name; |
| 18 } | 18 } |
| 19 return ref['preview']; | 19 return ref['preview']; |
| 20 } | 20 } |
| 21 | 21 |
| 22 // TODO(turnidge): This is here to workaround vm/dart2js differences. | 22 // TODO(turnidge): This is here to workaround vm/dart2js differences. |
| 23 dynamic expander() { | 23 dynamic expander() { |
| 24 return expandEvent; | 24 return expandEvent; |
| 25 } | 25 } |
| 26 | 26 |
| 27 void expandEvent(bool expand, var done) { | 27 void expandEvent(bool expand, var done) { |
| 28 print("Calling expandEvent"); | 28 print("Calling expandEvent"); |
| 29 if (expand) { | 29 if (expand) { |
| 30 app.requestManager.requestMap(url).then((map) { | 30 isolate.getMap(objectId).then((map) { |
| 31 print("Result is : $map"); | 31 print(map.runtimeType); |
| 32 ref['fields'] = map['fields']; | 32 print(map); |
|
turnidge
2014/03/05 21:02:47
debug
Cutch
2014/03/05 21:54:23
Done.
| |
| 33 ref['elements'] = map['elements']; | 33 ref['fields'] = map['fields']; |
| 34 ref['length'] = map['length']; | 34 ref['elements'] = map['elements']; |
| 35 print("ref is $ref"); | 35 ref['length'] = map['length']; |
| 36 print("ref is $ref"); | |
|
turnidge
2014/03/05 21:02:47
debug
Cutch
2014/03/05 21:54:23
Done.
| |
| 36 }).catchError((e, trace) { | 37 }).catchError((e, trace) { |
| 37 Logger.root.severe('Error while expanding instance-ref: $e\n$trace'); | 38 Logger.root.severe('Error while expanding instance-ref: $e\n$trace'); |
| 38 }).whenComplete(done); | 39 }).whenComplete(done); |
| 39 } else { | 40 } else { |
| 40 ref['fields'] = null; | 41 ref['fields'] = null; |
| 41 ref['elements'] = null; | 42 ref['elements'] = null; |
| 42 done(); | 43 done(); |
| 43 } | 44 } |
| 44 } | 45 } |
| 45 } | 46 } |
| OLD | NEW |