| Index: runtime/lib/mirrors_impl.dart
|
| ===================================================================
|
| --- runtime/lib/mirrors_impl.dart (revision 24825)
|
| +++ runtime/lib/mirrors_impl.dart (working copy)
|
| @@ -83,13 +83,17 @@
|
| final Map<Uri, LibraryMirror> libraries;
|
| final IsolateMirror isolate;
|
|
|
| + // TODO(11743): dynamicType and voidType should not respond to the
|
| + // ClassMirror protocol, so they should not inherit from the ClassMirror
|
| + // implementation.
|
| +
|
| TypeMirror _dynamicType = null;
|
|
|
| TypeMirror get dynamicType {
|
| if (_dynamicType == null) {
|
| _dynamicType =
|
| new _LocalClassMirrorImpl(
|
| - null, 'dynamic', false, null, null, [], null,
|
| + null, null, 'dynamic', false, null, null, [], null,
|
| const {}, const {}, const {});
|
| }
|
| return _dynamicType;
|
| @@ -101,7 +105,7 @@
|
| if (_voidType == null) {
|
| _voidType =
|
| new _LocalClassMirrorImpl(
|
| - null, 'void', false, null, null, [], null,
|
| + null, null, 'void', false, null, null, [], null,
|
| const {}, const {}, const {});
|
| }
|
| return _voidType;
|
| @@ -376,7 +380,8 @@
|
|
|
| class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl
|
| implements ClassMirror {
|
| - _LocalClassMirrorImpl(ref,
|
| + _LocalClassMirrorImpl(this._reflectee,
|
| + ref,
|
| String simpleName,
|
| this.isClass,
|
| this._owner,
|
| @@ -386,14 +391,24 @@
|
| Map<String, Mirror> members,
|
| Map<String, Mirror> constructors,
|
| Map<String, Mirror> typeVariables)
|
| - : this.simpleName = _s(simpleName),
|
| + : this._simpleName = _s(simpleName),
|
| this.members = _convertStringToSymbolMap(members),
|
| this.constructors = _convertStringToSymbolMap(constructors),
|
| this.typeVariables = _convertStringToSymbolMap(typeVariables),
|
| super(ref);
|
|
|
| - final Symbol simpleName;
|
| + final _MirrorReference _reflectee;
|
|
|
| + Symbol _simpleName;
|
| + Symbol get simpleName {
|
| + // dynamic, void and the function types have their names set eagerly in the
|
| + // constructor.
|
| + if(_simpleName == null) {
|
| + _simpleName = _s(_ClassMirror_name(_reflectee));
|
| + }
|
| + return _simpleName;
|
| + }
|
| +
|
| Symbol _qualifiedName = null;
|
| Symbol get qualifiedName {
|
| if (_qualifiedName == null) {
|
| @@ -558,6 +573,9 @@
|
|
|
| static _invokeConstructor(ref, constructorName, positionalArguments, async)
|
| native 'LocalClassMirrorImpl_invokeConstructor';
|
| +
|
| + static String _ClassMirror_name(reflectee)
|
| + native "ClassMirror_name";
|
| }
|
|
|
| class _LazyFunctionTypeMirror {
|
| @@ -578,7 +596,8 @@
|
| simpleName,
|
| this._returnType,
|
| this.parameters)
|
| - : super(ref,
|
| + : super(null,
|
| + ref,
|
| simpleName,
|
| true,
|
| null,
|
|
|