Chromium Code Reviews| 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'; |