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

Unified Diff: pkg/dartdoc/mirrors/dart2js_mirror.dart

Issue 10823390: Full typedef support in dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 8 years, 4 months 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 | « pkg/dartdoc/dartdoc.dart ('k') | tests/compiler/dart2js/mirrors_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dartdoc/mirrors/dart2js_mirror.dart
diff --git a/pkg/dartdoc/mirrors/dart2js_mirror.dart b/pkg/dartdoc/mirrors/dart2js_mirror.dart
index b85b10b64299aedbab233061764bd48ae19b2393..6177cd8ba7333c1bb22f07ac87c7f7e0ab39429e 100644
--- a/pkg/dartdoc/mirrors/dart2js_mirror.dart
+++ b/pkg/dartdoc/mirrors/dart2js_mirror.dart
@@ -594,7 +594,7 @@ class Dart2JsParameterMirror extends Dart2JsElementMirror
TypeMirror get type() => _convertTypeToTypeMirror(system,
_variableElement.computeType(system.compiler),
- system.compiler.dynamicClass.computeType(system.compiler),
+ system.compiler.types.dynamicType,
_variableElement.variables.functionSignature);
String get defaultValue() {
@@ -630,7 +630,7 @@ class Dart2JsFieldParameterMirror extends Dart2JsParameterMirror {
}
return _convertTypeToTypeMirror(system,
_fieldParameterElement.fieldElement.computeType(system.compiler),
- system.compiler.dynamicClass.computeType(system.compiler),
+ system.compiler.types.dynamicType,
_variableElement.variables.functionSignature);
}
@@ -719,7 +719,7 @@ class Dart2JsInterfaceMirror extends Dart2JsObjectMirror
Link<Type> link = _class.interfaces;
while (!link.isEmpty()) {
var type = _convertTypeToTypeMirror(system, link.head,
- system.compiler.dynamicClass.computeType(system.compiler));
+ system.compiler.types.dynamicType);
map[type.canonicalName] = type;
link = link.tail;
}
@@ -837,16 +837,23 @@ class Dart2JsTypedefMirror extends Dart2JsTypeElementMirror
List<TypeVariableMirror> get typeVariables() {
if (_typeVariables == null) {
_typeVariables = <TypeVariableMirror>[];
- // TODO(johnniwinther): Equip [Typedef] with a [typeParameters] map, just
- // like [ClassElement].
+ for (TypeVariableType typeVariable in _typedef.typeArguments) {
+ _typeVariables.add(
+ new Dart2JsTypeVariableMirror(system, typeVariable));
+ }
}
return _typeVariables;
}
TypeMirror get definition() {
if (_definition === null) {
- // TODO(johnniwinther): Provide access to the functionSignature of the
- // aliased function definition.
+ // TODO(johnniwinther): Should be [ensureResolved].
+ system.compiler.resolveTypedef(_typedef.element);
+ _definition = _convertTypeToTypeMirror(
+ system,
+ _typedef.element.alias,
+ system.compiler.types.dynamicType,
+ _typedef.element.functionSignature);
}
return _definition;
}
@@ -1017,7 +1024,7 @@ class Dart2JsInterfaceTypeMirror extends Dart2JsTypeElementMirror
Link<Type> type = _interfaceType.arguments;
while (type != null && type.head != null) {
_typeArguments.add(_convertTypeToTypeMirror(system, type.head,
- system.compiler.dynamicClass.computeType(system.compiler)));
+ system.compiler.types.dynamicType));
type = type.tail;
}
}
@@ -1131,7 +1138,7 @@ class Dart2JsFunctionTypeMirror extends Dart2JsTypeElementMirror
TypeMirror get returnType() {
return _convertTypeToTypeMirror(system, _functionType.returnType,
- system.compiler.dynamicClass.computeType(system.compiler));
+ system.compiler.types.dynamicType);
}
List<ParameterMirror> get parameters() {
@@ -1286,7 +1293,7 @@ class Dart2JsMethodMirror extends Dart2JsElementMirror
TypeMirror get returnType() => _convertTypeToTypeMirror(
system, _function.computeSignature(system.compiler).returnType,
- system.compiler.dynamicClass.computeType(system.compiler));
+ system.compiler.types.dynamicType);
bool get isConst() => _kind == Dart2JsMethodKind.CONST;
@@ -1353,7 +1360,7 @@ class Dart2JsFieldMirror extends Dart2JsElementMirror
TypeMirror get type() => _convertTypeToTypeMirror(system,
_variable.computeType(system.compiler),
- system.compiler.dynamicClass.computeType(system.compiler));
+ system.compiler.types.dynamicType);
Location get location() {
var script = _variable.getCompilationUnit().script;
« no previous file with comments | « pkg/dartdoc/dartdoc.dart ('k') | tests/compiler/dart2js/mirrors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698