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

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

Issue 10961074: Separate type for dynamic in mirrors.dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Identity used on dynamic type Created 8 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
//------------------------------------------------------------------------------
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698