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

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

Issue 10829168: Revert "Skeleton typedef type implementation" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « lib/compiler/implementation/typechecker.dart ('k') | tests/co19/co19-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dartdoc/mirrors/dart2js_mirror.dart
diff --git a/lib/dartdoc/mirrors/dart2js_mirror.dart b/lib/dartdoc/mirrors/dart2js_mirror.dart
index 66eeef939ec0e1cf3c35b50735306f2bcf560b36..5f1f3d99d2e67bf60677bdf055c215179c1ab8cd 100644
--- a/lib/dartdoc/mirrors/dart2js_mirror.dart
+++ b/lib/dartdoc/mirrors/dart2js_mirror.dart
@@ -61,11 +61,13 @@ Dart2JsTypeMirror _convertTypeToTypeMirror(
} else if (type is TypeVariableType) {
return new Dart2JsTypeVariableMirror(system, type);
} else if (type is FunctionType) {
- return new Dart2JsFunctionTypeMirror(system, type, functionSignature);
+ if (type.element is TypedefElement) {
+ return new Dart2JsTypedefMirror(system, type.element);
+ } else {
+ return new Dart2JsFunctionTypeMirror(system, type, functionSignature);
+ }
} else if (type is VoidType) {
return new Dart2JsVoidMirror(system, type);
- } else if (type is TypedefType) {
- return new Dart2JsTypedefMirror(system, type);
}
throw new IllegalArgumentException("Unexpected interface type $type");
}
@@ -500,8 +502,7 @@ class Dart2JsLibraryMirror extends Dart2JsObjectMirror
var type = new Dart2JsInterfaceMirror.fromLibrary(this, e);
_types[type.canonicalName] = type;
} else if (e.isTypedef()) {
- var type = new Dart2JsTypedefMirror.fromLibrary(this,
- e.computeType(system.compiler));
+ var type = new Dart2JsTypedefMirror.fromLibrary(this, e);
_types[type.canonicalName] = type;
}
}
@@ -794,31 +795,31 @@ class Dart2JsInterfaceMirror extends Dart2JsObjectMirror
}
}
-class Dart2JsTypedefMirror extends Dart2JsTypeElementMirror
+class Dart2JsTypedefMirror extends Dart2JsElementMirror
implements Dart2JsTypeMirror, TypedefMirror {
final Dart2JsLibraryMirror _library;
List<TypeVariableMirror> _typeVariables;
TypeMirror _definition;
- Dart2JsTypedefMirror(Dart2JsMirrorSystem system, TypedefType _typedef)
- : this._library = system.getLibrary(_typedef.element.getLibrary()),
+ Dart2JsTypedefMirror(Dart2JsMirrorSystem system, TypedefElement _typedef)
+ : this._library = system.getLibrary(_typedef.getLibrary()),
super(system, _typedef);
Dart2JsTypedefMirror.fromLibrary(Dart2JsLibraryMirror library,
- TypedefType _typedef)
+ TypedefElement _typedef)
: this._library = library,
super(library.system, _typedef);
- TypedefType get _typedef() => _type;
+ TypedefElement get _typedef() => _element;
String get canonicalName() => simpleName();
String qualifiedName() => '${library().qualifiedName()}.${simpleName()}';
Location location() {
- var node = _typedef.element.parseNode(_diagnosticListener);
+ var node = _typedef.parseNode(_diagnosticListener);
if (node !== null) {
- var script = _typedef.element.getCompilationUnit().script;
+ var script = _typedef.getCompilationUnit().script;
var span = system.compiler.spanFromNode(node, script.uri);
return new Dart2JsLocation(script, span);
}
@@ -905,8 +906,7 @@ class Dart2JsTypeVariableMirror extends Dart2JsTypeElementMirror
_typeVariableType.element.enclosingElement);
} else if (_typeVariableType.element.enclosingElement.isTypedef()) {
_declarer = new Dart2JsTypedefMirror(system,
- _typeVariableType.element.enclosingElement.computeType(
- system.compiler));
+ _typeVariableType.element.enclosingElement);
}
}
return _declarer;
« no previous file with comments | « lib/compiler/implementation/typechecker.dart ('k') | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698