| 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 library mirrors_dart2js; | 5 library mirrors_dart2js; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'dart:uri'; | 8 import 'dart:uri'; |
| 9 | 9 |
| 10 import '../../../../../lib/compiler/compiler.dart' as diagnostics; | 10 import '../../../../../lib/compiler/compiler.dart' as diagnostics; |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 if (_typeVariables == null) { | 898 if (_typeVariables == null) { |
| 899 _typeVariables = <TypeVariableMirror>[]; | 899 _typeVariables = <TypeVariableMirror>[]; |
| 900 for (TypeVariableType typeVariable in _typedef.typeArguments) { | 900 for (TypeVariableType typeVariable in _typedef.typeArguments) { |
| 901 _typeVariables.add( | 901 _typeVariables.add( |
| 902 new Dart2JsTypeVariableMirror(system, typeVariable)); | 902 new Dart2JsTypeVariableMirror(system, typeVariable)); |
| 903 } | 903 } |
| 904 } | 904 } |
| 905 return _typeVariables; | 905 return _typeVariables; |
| 906 } | 906 } |
| 907 | 907 |
| 908 TypeMirror get definition { | 908 TypeMirror get value { |
| 909 if (_definition === null) { | 909 if (_definition === null) { |
| 910 // TODO(johnniwinther): Should be [ensureResolved]. | 910 // TODO(johnniwinther): Should be [ensureResolved]. |
| 911 system.compiler.resolveTypedef(_typedef.element); | 911 system.compiler.resolveTypedef(_typedef.element); |
| 912 _definition = _convertTypeToTypeMirror( | 912 _definition = _convertTypeToTypeMirror( |
| 913 system, | 913 system, |
| 914 _typedef.element.alias, | 914 _typedef.element.alias, |
| 915 system.compiler.types.dynamicType, | 915 system.compiler.types.dynamicType, |
| 916 _typedef.element.functionSignature); | 916 _typedef.element.functionSignature); |
| 917 } | 917 } |
| 918 return _definition; | 918 return _definition; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 _declarer = new Dart2JsTypedefMirror(system, | 958 _declarer = new Dart2JsTypedefMirror(system, |
| 959 _typeVariableType.element.enclosingElement.computeType( | 959 _typeVariableType.element.enclosingElement.computeType( |
| 960 system.compiler)); | 960 system.compiler)); |
| 961 } | 961 } |
| 962 } | 962 } |
| 963 return _declarer; | 963 return _declarer; |
| 964 } | 964 } |
| 965 | 965 |
| 966 LibraryMirror get library => declarer.library; | 966 LibraryMirror get library => declarer.library; |
| 967 | 967 |
| 968 DeclarationMirror get owner => declarer; |
| 969 |
| 968 bool get isTypeVariable => true; | 970 bool get isTypeVariable => true; |
| 969 | 971 |
| 970 TypeMirror get bound => _convertTypeToTypeMirror( | 972 TypeMirror get upperBound => _convertTypeToTypeMirror( |
| 971 system, | 973 system, |
| 972 _typeVariableType.element.bound, | 974 _typeVariableType.element.bound, |
| 973 system.compiler.objectClass.computeType(system.compiler)); | 975 system.compiler.objectClass.computeType(system.compiler)); |
| 974 | 976 |
| 975 bool operator ==(Object other) { | 977 bool operator ==(Object other) { |
| 976 if (this === other) { | 978 if (this === other) { |
| 977 return true; | 979 return true; |
| 978 } | 980 } |
| 979 if (other is! TypeVariableMirror) { | 981 if (other is! TypeVariableMirror) { |
| 980 return false; | 982 return false; |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 if (node !== null) { | 1463 if (node !== null) { |
| 1462 var span = system.compiler.spanFromNode(node, script.uri); | 1464 var span = system.compiler.spanFromNode(node, script.uri); |
| 1463 return new Dart2JsLocation(script, span); | 1465 return new Dart2JsLocation(script, span); |
| 1464 } else { | 1466 } else { |
| 1465 var span = system.compiler.spanFromElement(_variable); | 1467 var span = system.compiler.spanFromElement(_variable); |
| 1466 return new Dart2JsLocation(script, span); | 1468 return new Dart2JsLocation(script, span); |
| 1467 } | 1469 } |
| 1468 } | 1470 } |
| 1469 } | 1471 } |
| 1470 | 1472 |
| OLD | NEW |