| Index: runtime/bin/vmservice/client/lib/src/elements/function_view.dart
|
| diff --git a/runtime/bin/vmservice/client/lib/src/elements/function_view.dart b/runtime/bin/vmservice/client/lib/src/elements/function_view.dart
|
| index 1c3620c24d91bde1b445ffaefc043a5eed8d28a7..66f1380259c5cf4ae3c92ffbb45f06f112a50b98 100644
|
| --- a/runtime/bin/vmservice/client/lib/src/elements/function_view.dart
|
| +++ b/runtime/bin/vmservice/client/lib/src/elements/function_view.dart
|
| @@ -14,7 +14,76 @@ class FunctionViewElement extends ObservatoryElement {
|
| @published ServiceMap function;
|
| FunctionViewElement.created() : super.created();
|
|
|
| + // TODO(turnidge): Once we create a Function object, these fields
|
| + // should move there.
|
| + @published String qualifiedName;
|
| + @published String kind;
|
| +
|
| + String _getQualifiedName(ServiceMap function) {
|
| + var parent = (function != null && function['parent'] != null
|
| + ? function['parent'] : null);
|
| + if (parent != null) {
|
| + return "${_getQualifiedName(parent)}.${function['user_name']}";
|
| + }
|
| + var cls = (function != null &&
|
| + function['class'] != null &&
|
| + function['class']['user_name'] != null &&
|
| + function['class']['user_name'] != '::'
|
| + ? function['class'] : null);
|
| + if (cls != null) {
|
| + return "${cls['user_name']}.${function['user_name']}";
|
| + }
|
| + return "${function['username']}";
|
| + }
|
| +
|
| + void functionChanged(oldValue) {
|
| + notifyPropertyChange(#qualifiedName, 0, 1);
|
| + notifyPropertyChange(#kind, 0, 1);
|
| + qualifiedName = _getQualifiedName(function);
|
| + switch(function['kind']) {
|
| + case 'kRegularFunction':
|
| + kind = 'function';
|
| + break;
|
| + case 'kClosureFunction':
|
| + kind = 'closure function';
|
| + break;
|
| + case 'kSignatureFunction':
|
| + kind = 'signature function';
|
| + break;
|
| + case 'kGetterFunction':
|
| + kind = 'getter function';
|
| + break;
|
| + case 'kSetterFunction':
|
| + kind = 'setter function';
|
| + break;
|
| + case 'kConstructor':
|
| + kind = 'constructor';
|
| + break;
|
| + case 'kImplicitGetterFunction':
|
| + kind = 'implicit getter function';
|
| + break;
|
| + case 'kImplicitSetterFunction':
|
| + kind = 'implicit setter function';
|
| + break;
|
| + case 'kStaticInitializer':
|
| + kind = 'static initializer';
|
| + break;
|
| + case 'kMethodExtractor':
|
| + kind = 'method extractor';
|
| + break;
|
| + case 'kNoSuchMethodDispatcher':
|
| + kind = 'noSuchMethod dispatcher';
|
| + break;
|
| + case 'kInvokeFieldDispatcher':
|
| + kind = 'invoke field dispatcher';
|
| + break;
|
| + default:
|
| + kind = 'UNKNOWN';
|
| + break;
|
| + }
|
| + }
|
| +
|
| void refresh(var done) {
|
| function.reload().whenComplete(done);
|
| }
|
| -}
|
| +}
|
|
|