Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Unified Diff: tool/input_sdk/private/js_mirrors.dart

Issue 1489043002: More mirrors (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Cleanup Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/dart/_js_mirrors.js ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..41b9cbd5c38b1a80ff6412f6c052838fb03034f2 100644
--- a/tool/input_sdk/private/js_mirrors.dart
+++ b/tool/input_sdk/private/js_mirrors.dart
@@ -120,11 +120,13 @@ class JsClassMirror implements ClassMirror {
}
List<ClassMirror> get superinterfaces {
- var interfaces = JS('Function', '#[dart.implements]', _cls);
- if (interfaces == null) {
+ var interfaceThunk = JS('Function', '#[dart.implements]', _cls);
+ if (interfaceThunk == null) {
return [];
+ } else {
+ List<Type> interfaces = interfaceThunk();
+ return interfaces.map((t) => new JsClassMirror._(t)).toList();
}
- throw new UnimplementedError("ClassMirror.superinterfaces unimplemented");
}
// TODO(vsm): Implement
@@ -159,18 +161,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
+ // 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 +338,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 =>
« no previous file with comments | « lib/runtime/dart/_js_mirrors.js ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698