Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: sdk/lib/mirrors/mirrors.dart

Issue 154733003: Access to imports in the VM's runtime mirrors. Extend test coverage of the source mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/lib/js_mirrors.dart ('k') | tests/compiler/dart2js/dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // For the purposes of the mirrors library, we adopt a naming 5 // For the purposes of the mirrors library, we adopt a naming
6 // convention with respect to getters and setters. Specifically, for 6 // convention with respect to getters and setters. Specifically, for
7 // some variable or field... 7 // some variable or field...
8 // 8 //
9 // var myField; 9 // var myField;
10 // 10 //
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 * 612 *
613 * (r1, ..., rn, [p1 = d1, ..., pk = dk]) { 613 * (r1, ..., rn, [p1 = d1, ..., pk = dk]) {
614 * return this.invoke(name, [r1, ..., rn, p1, ..., pk]); 614 * return this.invoke(name, [r1, ..., rn, p1, ..., pk]);
615 * } 615 * }
616 * 616 *
617 * if m has required parameters r1, ..., rn, and optional positional 617 * if m has required parameters r1, ..., rn, and optional positional
618 * parameters p1, ..., pk with defaults d1, ..., dk. Otherwise, an 618 * parameters p1, ..., pk with defaults d1, ..., dk. Otherwise, an
619 * [ArgumentError] is thrown. 619 * [ArgumentError] is thrown.
620 */ 620 */
621 Function operator [](Symbol name); 621 Function operator [](Symbol name);
622
623 /**
624 * Returns a list of the imports and exports in this library;
625 */
626 List<LibraryDependencyMirror> get libraryDependencies;
627 }
628
629 /// A mirror on an import or export declaration.
630 abstract class LibraryDependencyMirror {
631 /// Is `true` if this dependency is an import.
632 bool get isImport;
633
634 /// Is `true` if this dependency is an export.
635 bool get isExport;
636
637 /// Returns the library mirror of the library that imports or exports the
638 /// [targetLibrary].
639 LibraryMirror get sourceLibrary;
640
641 /// Returns the library mirror of the library that is imported or exported.
642 LibraryMirror get targetLibrary;
643
644 /// Returns the prefix if this is a prefixed import and `null` otherwise.
645 Symbol get prefix;
646
647 /// Returns the list of show/hide combinators on the import/export
648 /// declaration.
649 List<CombinatorMirror> get combinators;
650
651 /// Returns the source location for this import/export declaration.
652 SourceLocation get location;
653
654 List<InstanceMirror> get metadata;
655 }
656
657 /// A mirror on a show/hide combinator declared on a library dependency.
658 abstract class CombinatorMirror {
659 /// The list of identifiers on the combinator.
660 List<Symbol> get identifiers;
661
662 /// Is `true` if this is a 'show' combinator.
663 bool get isShow;
664
665 /// Is `true` if this is a 'hide' combinator.
666 bool get isHide;
622 } 667 }
623 668
624 /** 669 /**
625 * A [TypeMirror] reflects a Dart language class, typedef, 670 * A [TypeMirror] reflects a Dart language class, typedef,
626 * function type or type variable. 671 * function type or type variable.
627 */ 672 */
628 abstract class TypeMirror implements DeclarationMirror { 673 abstract class TypeMirror implements DeclarationMirror {
629 /** 674 /**
630 * An immutable list with mirrors for all type variables for this type. 675 * An immutable list with mirrors for all type variables for this type.
631 * 676 *
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 * 1275 *
1231 * When used as metadata on an import of "dart:mirrors", this metadata does 1276 * When used as metadata on an import of "dart:mirrors", this metadata does
1232 * not apply to the library in which the annotation is used, but instead 1277 * not apply to the library in which the annotation is used, but instead
1233 * applies to the other libraries (all libraries if "*" is used). 1278 * applies to the other libraries (all libraries if "*" is used).
1234 */ 1279 */
1235 final override; 1280 final override;
1236 1281
1237 const MirrorsUsed( 1282 const MirrorsUsed(
1238 {this.symbols, this.targets, this.metaTargets, this.override}); 1283 {this.symbols, this.targets, this.metaTargets, this.override});
1239 } 1284 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/lib/js_mirrors.dart ('k') | tests/compiler/dart2js/dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698