Chromium Code Reviews| Index: tool/input_sdk/private/js_mirrors.dart |
| diff --git a/tool/input_sdk/private/js_mirrors.dart b/tool/input_sdk/private/js_mirrors.dart |
| index 71c108fc607814e3544de927e2fa671ab5dd7d19..036a241832f0490579ae10abb3966e6a71189647 100644 |
| --- a/tool/input_sdk/private/js_mirrors.dart |
| +++ b/tool/input_sdk/private/js_mirrors.dart |
| @@ -123,8 +123,9 @@ class JsClassMirror implements ClassMirror { |
| var interfaces = JS('Function', '#[dart.implements]', _cls); |
| if (interfaces == null) { |
| return []; |
| + } else { |
| + return interfaces().map((t) => new JsClassMirror._(t)); |
|
Jennifer Messerly
2015/12/01 16:41:39
add a .toList() here?
and is this function allowe
vsm
2015/12/01 17:00:01
Done.
|
| } |
| - throw new UnimplementedError("ClassMirror.superinterfaces unimplemented"); |
| } |
| // TODO(vsm): Implement |
| @@ -159,18 +160,25 @@ class JsClassMirror implements ClassMirror { |
| throw new UnimplementedError("ClassMirror.location unimplemented"); |
| ClassMirror get mixin => |
| throw new UnimplementedError("ClassMirror.mixin unimplemented"); |
| - TypeMirror get originalDeclaration => throw new UnimplementedError( |
| - "ClassMirror.originalDeclaration unimplemented"); |
| + TypeMirror get originalDeclaration { |
| + // TODO(vsm): Handle generic case. How should we represent an original |
|
Jennifer Messerly
2015/12/01 16:41:39
FWIW, the VM implementation:
https://github.com/da
vsm
2015/12/01 17:00:01
We don't implement isOriginalDeclaration yet. We
|
| + // declaration for a generic class? |
| + return this; |
| + } |
| DeclarationMirror get owner => |
| throw new UnimplementedError("ClassMirror.owner unimplemented"); |
| Symbol get qualifiedName => |
| throw new UnimplementedError("ClassMirror.qualifiedName unimplemented"); |
| - Type get reflectedType => |
| - throw new UnimplementedError("ClassMirror.reflectedType unimplemented"); |
| + Type get reflectedType { return _cls; } |
| Map<Symbol, MethodMirror> get staticMembers => |
| throw new UnimplementedError("ClassMirror.staticMembers unimplemented"); |
| - ClassMirror get superclass => |
| - throw new UnimplementedError("ClassMirror.superclass unimplemented"); |
| + ClassMirror get superclass { |
| + if (_cls == Object) { |
| + return null; |
| + } else { |
| + return new JsClassMirror._(JS('Type', '#.__proto__', _cls)); |
| + } |
| + } |
| List<TypeMirror> get typeArguments => |
| throw new UnimplementedError("ClassMirror.typeArguments unimplemented"); |
| List<TypeVariableMirror> get typeVariables => |
| @@ -329,8 +337,10 @@ class JsMethodMirror implements MethodMirror { |
| throw new UnimplementedError("MethodMirror.isTopLevel unimplemented"); |
| SourceLocation get location => |
| throw new UnimplementedError("MethodMirror.location unimplemented"); |
| - List<InstanceMirror> get metadata => |
| - throw new UnimplementedError("MethodMirror.metadata unimplemented"); |
| + List<InstanceMirror> get metadata { |
| + // TODO(vsm): Parse and store method metadata |
| + return <InstanceMirror>[]; |
| + } |
| DeclarationMirror get owner => |
| throw new UnimplementedError("MethodMirror.owner unimplemented"); |
| Symbol get qualifiedName => |