| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // VM-specific implementation of the dart:mirrors library. | 5 // VM-specific implementation of the dart:mirrors library. |
| 6 | 6 |
| 7 import "dart:collection"; | 7 import "dart:collection"; |
| 8 | 8 |
| 9 final emptyList = new UnmodifiableListView([]); | 9 final emptyList = new UnmodifiableListView([]); |
| 10 final emptyMap = new _UnmodifiableMapView({}); | 10 final emptyMap = new _UnmodifiableMapView({}); |
| (...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 } | 1408 } |
| 1409 | 1409 |
| 1410 class _SpecialTypeMirrorImpl extends _LocalMirrorImpl | 1410 class _SpecialTypeMirrorImpl extends _LocalMirrorImpl |
| 1411 implements TypeMirror, DeclarationMirror { | 1411 implements TypeMirror, DeclarationMirror { |
| 1412 _SpecialTypeMirrorImpl(String name) : simpleName = _s(name); | 1412 _SpecialTypeMirrorImpl(String name) : simpleName = _s(name); |
| 1413 | 1413 |
| 1414 final bool isPrivate = false; | 1414 final bool isPrivate = false; |
| 1415 final DeclarationMirror owner = null; | 1415 final DeclarationMirror owner = null; |
| 1416 final Symbol simpleName; | 1416 final Symbol simpleName; |
| 1417 final bool isTopLevel = true; | 1417 final bool isTopLevel = true; |
| 1418 // Fixed length 0, therefore immutable. | |
| 1419 final List<InstanceMirror> metadata = emptyList; | 1418 final List<InstanceMirror> metadata = emptyList; |
| 1420 | 1419 |
| 1420 List<TypeVariableMirror> get typeVariables => emptyList; |
| 1421 List<TypeMirror> get typeArguments => emptyList; |
| 1422 |
| 1423 bool get isOriginalDeclaration => true; |
| 1424 TypeMirror get originalDeclaration => this; |
| 1425 |
| 1421 SourceLocation get location { | 1426 SourceLocation get location { |
| 1422 throw new UnimplementedError('TypeMirror.location is not implemented'); | 1427 throw new UnimplementedError('TypeMirror.location is not implemented'); |
| 1423 } | 1428 } |
| 1424 | 1429 |
| 1425 Symbol get qualifiedName => simpleName; | 1430 Symbol get qualifiedName => simpleName; |
| 1426 | 1431 |
| 1427 // TODO(11955): Remove once dynamicType and voidType are canonical objects in | 1432 // TODO(11955): Remove once dynamicType and voidType are canonical objects in |
| 1428 // the object store. | 1433 // the object store. |
| 1429 bool operator ==(other) { | 1434 bool operator ==(other) { |
| 1430 if (other is! _SpecialTypeMirrorImpl) { | 1435 if (other is! _SpecialTypeMirrorImpl) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1505 if (typeMirror == null) { | 1510 if (typeMirror == null) { |
| 1506 typeMirror = makeLocalTypeMirror(key); | 1511 typeMirror = makeLocalTypeMirror(key); |
| 1507 _instanitationCache[key] = typeMirror; | 1512 _instanitationCache[key] = typeMirror; |
| 1508 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1513 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
| 1509 _declarationCache[key] = typeMirror; | 1514 _declarationCache[key] = typeMirror; |
| 1510 } | 1515 } |
| 1511 } | 1516 } |
| 1512 return typeMirror; | 1517 return typeMirror; |
| 1513 } | 1518 } |
| 1514 } | 1519 } |
| OLD | NEW |