| 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', prefix: 'diagnostics'); | 10 #import('../../../../../lib/compiler/compiler.dart', prefix: 'diagnostics'); |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 map[type.canonicalName] = type; | 747 map[type.canonicalName] = type; |
| 748 link = link.tail; | 748 link = link.tail; |
| 749 } | 749 } |
| 750 return new ImmutableMapWrapper<Object, InterfaceMirror>(map); | 750 return new ImmutableMapWrapper<Object, InterfaceMirror>(map); |
| 751 } | 751 } |
| 752 | 752 |
| 753 bool get isClass => !_class.isInterface(); | 753 bool get isClass => !_class.isInterface(); |
| 754 | 754 |
| 755 bool get isInterface => _class.isInterface(); | 755 bool get isInterface => _class.isInterface(); |
| 756 | 756 |
| 757 bool get isAbstract => |
| 758 _class.modifiers !== null && _class.modifiers.isAbstract(); |
| 759 |
| 757 bool get isPrivate => _isPrivate(simpleName); | 760 bool get isPrivate => _isPrivate(simpleName); |
| 758 | 761 |
| 759 bool get isDeclaration => true; | 762 bool get isDeclaration => true; |
| 760 | 763 |
| 761 List<TypeMirror> get typeArguments { | 764 List<TypeMirror> get typeArguments { |
| 762 throw new UnsupportedOperationException( | 765 throw new UnsupportedOperationException( |
| 763 'Declarations do not have type arguments'); | 766 'Declarations do not have type arguments'); |
| 764 } | 767 } |
| 765 | 768 |
| 766 List<TypeVariableMirror> get typeVariables { | 769 List<TypeVariableMirror> get typeVariables { |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 // TODO(johnniwinther): Substitute type arguments for type variables. | 1018 // TODO(johnniwinther): Substitute type arguments for type variables. |
| 1016 InterfaceMirror get superclass => declaration.superclass; | 1019 InterfaceMirror get superclass => declaration.superclass; |
| 1017 | 1020 |
| 1018 // TODO(johnniwinther): Substitute type arguments for type variables. | 1021 // TODO(johnniwinther): Substitute type arguments for type variables. |
| 1019 Map<Object, InterfaceMirror> get interfaces => declaration.interfaces; | 1022 Map<Object, InterfaceMirror> get interfaces => declaration.interfaces; |
| 1020 | 1023 |
| 1021 bool get isClass => declaration.isClass; | 1024 bool get isClass => declaration.isClass; |
| 1022 | 1025 |
| 1023 bool get isInterface => declaration.isInterface; | 1026 bool get isInterface => declaration.isInterface; |
| 1024 | 1027 |
| 1028 bool get isAbstract => declaration.isAbstract; |
| 1029 |
| 1025 bool get isPrivate => declaration.isPrivate; | 1030 bool get isPrivate => declaration.isPrivate; |
| 1026 | 1031 |
| 1027 bool get isDeclaration => false; | 1032 bool get isDeclaration => false; |
| 1028 | 1033 |
| 1029 List<TypeMirror> get typeArguments { | 1034 List<TypeMirror> get typeArguments { |
| 1030 if (_typeArguments == null) { | 1035 if (_typeArguments == null) { |
| 1031 _typeArguments = <TypeMirror>[]; | 1036 _typeArguments = <TypeMirror>[]; |
| 1032 Link<DartType> type = _interfaceType.arguments; | 1037 Link<DartType> type = _interfaceType.arguments; |
| 1033 while (type != null && type.head != null) { | 1038 while (type != null && type.head != null) { |
| 1034 _typeArguments.add(_convertTypeToTypeMirror(system, type.head, | 1039 _typeArguments.add(_convertTypeToTypeMirror(system, type.head, |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 | 1315 |
| 1311 List<ParameterMirror> get parameters { | 1316 List<ParameterMirror> get parameters { |
| 1312 return _parametersFromFunctionSignature(system, this, | 1317 return _parametersFromFunctionSignature(system, this, |
| 1313 _function.computeSignature(system.compiler)); | 1318 _function.computeSignature(system.compiler)); |
| 1314 } | 1319 } |
| 1315 | 1320 |
| 1316 TypeMirror get returnType => _convertTypeToTypeMirror( | 1321 TypeMirror get returnType => _convertTypeToTypeMirror( |
| 1317 system, _function.computeSignature(system.compiler).returnType, | 1322 system, _function.computeSignature(system.compiler).returnType, |
| 1318 system.compiler.types.dynamicType); | 1323 system.compiler.types.dynamicType); |
| 1319 | 1324 |
| 1325 bool get isAbstract => |
| 1326 _function.modifiers !== null && _function.modifiers.isAbstract(); |
| 1327 |
| 1320 bool get isConst => _kind == Dart2JsMethodKind.CONST; | 1328 bool get isConst => _kind == Dart2JsMethodKind.CONST; |
| 1321 | 1329 |
| 1322 bool get isFactory => _kind == Dart2JsMethodKind.FACTORY; | 1330 bool get isFactory => _kind == Dart2JsMethodKind.FACTORY; |
| 1323 | 1331 |
| 1324 String get constructorName => _constructorName; | 1332 String get constructorName => _constructorName; |
| 1325 | 1333 |
| 1326 bool get isGetter => _kind == Dart2JsMethodKind.GETTER; | 1334 bool get isGetter => _kind == Dart2JsMethodKind.GETTER; |
| 1327 | 1335 |
| 1328 bool get isSetter => _kind == Dart2JsMethodKind.SETTER; | 1336 bool get isSetter => _kind == Dart2JsMethodKind.SETTER; |
| 1329 | 1337 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1391 if (node !== null) { | 1399 if (node !== null) { |
| 1392 var span = system.compiler.spanFromNode(node, script.uri); | 1400 var span = system.compiler.spanFromNode(node, script.uri); |
| 1393 return new Dart2JsLocation(script, span); | 1401 return new Dart2JsLocation(script, span); |
| 1394 } else { | 1402 } else { |
| 1395 var span = system.compiler.spanFromElement(_variable); | 1403 var span = system.compiler.spanFromElement(_variable); |
| 1396 return new Dart2JsLocation(script, span); | 1404 return new Dart2JsLocation(script, span); |
| 1397 } | 1405 } |
| 1398 } | 1406 } |
| 1399 } | 1407 } |
| 1400 | 1408 |
| OLD | NEW |