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:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import '../../compiler.dart' as api; | 9 import '../../compiler.dart' as api; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 return new AsFilteredImmutableMap<String, MemberMirror, MethodMirror>( | 485 return new AsFilteredImmutableMap<String, MemberMirror, MethodMirror>( |
486 _members, | 486 _members, |
487 (MemberMirror member) => member is MethodMirror ? member : null); | 487 (MemberMirror member) => member is MethodMirror ? member : null); |
488 } | 488 } |
489 | 489 |
490 Map<String, MethodMirror> get getters { | 490 Map<String, MethodMirror> get getters { |
491 _ensureMembers(); | 491 _ensureMembers(); |
492 return new AsFilteredImmutableMap<String, MemberMirror, MethodMirror>( | 492 return new AsFilteredImmutableMap<String, MemberMirror, MethodMirror>( |
493 _members, | 493 _members, |
494 (MemberMirror member) => | 494 (MemberMirror member) => |
495 member is MethodMirror && (member as MethodMirror).isGetter ? | 495 member is MethodMirror && member.isGetter ? member : null); |
496 member : null); | |
497 } | 496 } |
498 | 497 |
499 Map<String, MethodMirror> get setters { | 498 Map<String, MethodMirror> get setters { |
500 _ensureMembers(); | 499 _ensureMembers(); |
501 return new AsFilteredImmutableMap<String, MemberMirror, MethodMirror>( | 500 return new AsFilteredImmutableMap<String, MemberMirror, MethodMirror>( |
502 _members, | 501 _members, |
503 (MemberMirror member) => | 502 (MemberMirror member) => |
504 member is MethodMirror && (member as MethodMirror).isSetter ? | 503 member is MethodMirror && member.isSetter ? member : null); |
505 member : null); | |
506 } | 504 } |
507 | 505 |
508 Map<String, VariableMirror> get variables { | 506 Map<String, VariableMirror> get variables { |
509 _ensureMembers(); | 507 _ensureMembers(); |
510 return new AsFilteredImmutableMap<String, MemberMirror, VariableMirror>( | 508 return new AsFilteredImmutableMap<String, MemberMirror, VariableMirror>( |
511 _members, | 509 _members, |
512 (MemberMirror member) => member is VariableMirror ? member : null); | 510 (MemberMirror member) => member is VariableMirror ? member : null); |
513 } | 511 } |
514 } | 512 } |
515 | 513 |
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1749 * | 1747 * |
1750 * All API in this class is experimental. | 1748 * All API in this class is experimental. |
1751 */ | 1749 */ |
1752 class BackDoor { | 1750 class BackDoor { |
1753 /// Return the compilation units comprising [library]. | 1751 /// Return the compilation units comprising [library]. |
1754 static List<Mirror> compilationUnitsOf(Dart2JsLibraryMirror library) { | 1752 static List<Mirror> compilationUnitsOf(Dart2JsLibraryMirror library) { |
1755 return library._library.compilationUnits.toList().map( | 1753 return library._library.compilationUnits.toList().map( |
1756 (cu) => new Dart2JsCompilationUnitMirror(cu, library)).toList(); | 1754 (cu) => new Dart2JsCompilationUnitMirror(cu, library)).toList(); |
1757 } | 1755 } |
1758 } | 1756 } |
OLD | NEW |