Chromium Code Reviews| Index: pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart |
| diff --git a/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart b/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart |
| index 4a4da301622ccb4e71e0b0bb4c1ddb11fb38929c..2c8c89af5357a7295222b0a421319cbf803269be 100644 |
| --- a/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart |
| +++ b/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart |
| @@ -59,7 +59,11 @@ Dart2JsTypeMirror _convertTypeToTypeMirror( |
| if (type === null) { |
| return new Dart2JsInterfaceTypeMirror(system, defaultType); |
| } else if (type is InterfaceType) { |
| - return new Dart2JsInterfaceTypeMirror(system, type); |
| + if (type === system.compiler.types.dynamicType) { |
| + return new Dart2JsDynamicMirror(system, type); |
| + } else { |
| + return new Dart2JsInterfaceTypeMirror(system, type); |
| + } |
| } else if (type is TypeVariableType) { |
| return new Dart2JsTypeVariableMirror(system, type); |
| } else if (type is FunctionType) { |
| @@ -1212,6 +1216,48 @@ class Dart2JsVoidMirror extends Dart2JsTypeElementMirror { |
| } |
| } |
| +class Dart2JsDynamicMirror extends Dart2JsTypeElementMirror { |
| + |
| + Dart2JsDynamicMirror(Dart2JsMirrorSystem system, InterfaceType voidType) |
| + : super(system, voidType); |
| + |
| + InterfaceType get _dynamicType => _type; |
| + |
| + String get qualifiedName => simpleName; |
| + |
| + /** |
| + * The dynamic type has no location. |
| + */ |
| + Location get location => null; |
| + |
| + /** |
| + * The dynamic type has no library. |
| + */ |
| + LibraryMirror get library => null; |
| + |
| + bool get isObject => false; |
|
Lasse Reichstein Nielsen
2012/09/24 10:41:09
Why not put these "false" getters on the supertype
Johnni Winther
2012/09/24 10:58:18
Done.
|
| + |
| + bool get isVoid => false; |
| + |
| + bool get isDynamic => true; |
| + |
| + bool get isTypeVariable => false; |
| + |
| + bool get isTypedef => false; |
| + |
| + bool get isFunction => false; |
| + |
| + bool operator ==(Object other) { |
| + if (this === other) { |
| + return true; |
| + } |
| + if (other is! TypeMirror) { |
| + return false; |
| + } |
| + return other.isDynamic; |
| + } |
| +} |
| + |
| //------------------------------------------------------------------------------ |
| // Member mirrors implementation. |
| //------------------------------------------------------------------------------ |