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 22 matching lines...) Expand all Loading... |
33 bool _isPrivate(String name) { | 33 bool _isPrivate(String name) { |
34 return name.startsWith('_'); | 34 return name.startsWith('_'); |
35 } | 35 } |
36 | 36 |
37 List<ParameterMirror> _parametersFromFunctionSignature( | 37 List<ParameterMirror> _parametersFromFunctionSignature( |
38 Dart2JsMirrorSystem system, | 38 Dart2JsMirrorSystem system, |
39 Dart2JsMethodMirror method, | 39 Dart2JsMethodMirror method, |
40 FunctionSignature signature) { | 40 FunctionSignature signature) { |
41 var parameters = <ParameterMirror>[]; | 41 var parameters = <ParameterMirror>[]; |
42 Link<Element> link = signature.requiredParameters; | 42 Link<Element> link = signature.requiredParameters; |
43 while (!link.isEmpty()) { | 43 while (!link.isEmpty) { |
44 parameters.add(new Dart2JsParameterMirror( | 44 parameters.add(new Dart2JsParameterMirror( |
45 system, method, link.head, false)); | 45 system, method, link.head, false)); |
46 link = link.tail; | 46 link = link.tail; |
47 } | 47 } |
48 link = signature.optionalParameters; | 48 link = signature.optionalParameters; |
49 while (!link.isEmpty()) { | 49 while (!link.isEmpty) { |
50 parameters.add(new Dart2JsParameterMirror( | 50 parameters.add(new Dart2JsParameterMirror( |
51 system, method, link.head, true)); | 51 system, method, link.head, true)); |
52 link = link.tail; | 52 link = link.tail; |
53 } | 53 } |
54 return parameters; | 54 return parameters; |
55 } | 55 } |
56 | 56 |
57 Dart2JsTypeMirror _convertTypeToTypeMirror( | 57 Dart2JsTypeMirror _convertTypeToTypeMirror( |
58 Dart2JsMirrorSystem system, | 58 Dart2JsMirrorSystem system, |
59 DartType type, | 59 DartType type, |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 InterfaceMirror get superclass { | 730 InterfaceMirror get superclass { |
731 if (_class.supertype != null) { | 731 if (_class.supertype != null) { |
732 return new Dart2JsInterfaceTypeMirror(system, _class.supertype); | 732 return new Dart2JsInterfaceTypeMirror(system, _class.supertype); |
733 } | 733 } |
734 return null; | 734 return null; |
735 } | 735 } |
736 | 736 |
737 List<InterfaceMirror> get interfaces { | 737 List<InterfaceMirror> get interfaces { |
738 var list = <InterfaceMirror>[]; | 738 var list = <InterfaceMirror>[]; |
739 Link<DartType> link = _class.interfaces; | 739 Link<DartType> link = _class.interfaces; |
740 while (!link.isEmpty()) { | 740 while (!link.isEmpty) { |
741 var type = _convertTypeToTypeMirror(system, link.head, | 741 var type = _convertTypeToTypeMirror(system, link.head, |
742 system.compiler.types.dynamicType); | 742 system.compiler.types.dynamicType); |
743 list.add(type); | 743 list.add(type); |
744 link = link.tail; | 744 link = link.tail; |
745 } | 745 } |
746 return list; | 746 return list; |
747 } | 747 } |
748 | 748 |
749 bool get isClass => !_class.isInterface(); | 749 bool get isClass => !_class.isInterface(); |
750 | 750 |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 if (node !== null) { | 1389 if (node !== null) { |
1390 var span = system.compiler.spanFromNode(node, script.uri); | 1390 var span = system.compiler.spanFromNode(node, script.uri); |
1391 return new Dart2JsLocation(script, span); | 1391 return new Dart2JsLocation(script, span); |
1392 } else { | 1392 } else { |
1393 var span = system.compiler.spanFromElement(_variable); | 1393 var span = system.compiler.spanFromElement(_variable); |
1394 return new Dart2JsLocation(script, span); | 1394 return new Dart2JsLocation(script, span); |
1395 } | 1395 } |
1396 } | 1396 } |
1397 } | 1397 } |
1398 | 1398 |
OLD | NEW |