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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 18343005: Implement dynamicType and voidType as TypeMirrors not ClassMirrors. Issue 11743. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | runtime/tests/vm/dart/isolate_mirror_local_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors_impl.dart
===================================================================
--- runtime/lib/mirrors_impl.dart (revision 24929)
+++ runtime/lib/mirrors_impl.dart (working copy)
@@ -91,10 +91,7 @@
TypeMirror get dynamicType {
if (_dynamicType == null) {
- _dynamicType =
- new _LocalClassMirrorImpl(
- null, null, 'dynamic', false, null, null, [], null,
- const {}, const {}, const {});
+ _dynamicType = new _SpecialTypeMirrorImpl(_s('dynamic'));
}
return _dynamicType;
}
@@ -103,10 +100,7 @@
TypeMirror get voidType {
if (_voidType == null) {
- _voidType =
- new _LocalClassMirrorImpl(
- null, null, 'void', false, null, null, [], null,
- const {}, const {}, const {});
+ _voidType = new _SpecialTypeMirrorImpl(_s('void'));
}
return _voidType;
}
@@ -1023,6 +1017,28 @@
}
}
+class _SpecialTypeMirrorImpl extends _LocalMirrorImpl
+ implements TypeMirror, DeclarationMirror {
+ _SpecialTypeMirrorImpl(this.simpleName);
+
+ final bool isPrivate = false;
+ final bool isTopLevel = true;
+ final List<InstanceMirror> metadata = new List(0); // Fixed length 0, therefore immutable.
siva 2013/07/15 05:47:11 Does the comment line fit in 80 chars?
+ final DeclarationMirror owner = null;
+ final Symbol simpleName;
+
+ SourceLocation get location {
+ throw new UnimplementedError(
+ 'TypeMirror.location is not implemented');
+ }
+
+ Symbol get qualifiedName {
+ return simpleName;
+ }
+
+ String toString() => "TypeMirror on '${_n(simpleName)}'";
+}
+
class _Mirrors {
// Does a port refer to our local isolate?
static bool isLocalPort(SendPort port) native 'Mirrors_isLocalPort';
« no previous file with comments | « no previous file | runtime/tests/vm/dart/isolate_mirror_local_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698