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

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

Issue 23038010: Fix Function.end_token_pos() and implement MethodMirror.source getter (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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
OLDNEW
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 // 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 * A [ClosureMirror] provides access to its captured variables and 524 * A [ClosureMirror] provides access to its captured variables and
525 * provides the ability to execute its reflectee. 525 * provides the ability to execute its reflectee.
526 */ 526 */
527 abstract class ClosureMirror implements InstanceMirror { 527 abstract class ClosureMirror implements InstanceMirror {
528 /** 528 /**
529 * A mirror on the function associated with this closure. 529 * A mirror on the function associated with this closure.
530 */ 530 */
531 MethodMirror get function; 531 MethodMirror get function;
532 532
533 /** 533 /**
534 * The source code for this closure, if available. Otherwise null.
535 *
536 * TODO(turnidge): Would this just be available in function?
537 */
538 String get source;
539
540 /**
541 * Executes the closure and returns a mirror on the result. 534 * Executes the closure and returns a mirror on the result.
542 * Let *f* be the closure reflected by this mirror, 535 * Let *f* be the closure reflected by this mirror,
543 * let *a1, ..., an* be the elements of [positionalArguments] 536 * let *a1, ..., an* be the elements of [positionalArguments]
544 * let *k1, ..., km* be the identifiers denoted by the elements of 537 * let *k1, ..., km* be the identifiers denoted by the elements of
545 * [namedArguments.keys] 538 * [namedArguments.keys]
546 * and let *v1, ..., vm* be the elements of [namedArguments.values]. 539 * and let *v1, ..., vm* be the elements of [namedArguments.values].
547 * Then this method will perform the method invocation 540 * Then this method will perform the method invocation
548 * *f(a1, ..., an, k1: v1, ..., km: vm)* 541 * *f(a1, ..., an, k1: v1, ..., km: vm)*
549 * If the invocation returns a result *r*, this method returns 542 * If the invocation returns a result *r*, this method returns
550 * the result of calling [reflect](*r*). 543 * the result of calling [reflect](*r*).
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 * A [MethodMirror] reflects a Dart language function, method, 926 * A [MethodMirror] reflects a Dart language function, method,
934 * constructor, getter, or setter. 927 * constructor, getter, or setter.
935 */ 928 */
936 abstract class MethodMirror implements DeclarationMirror { 929 abstract class MethodMirror implements DeclarationMirror {
937 /** 930 /**
938 * A mirror on the return type for the reflectee. 931 * A mirror on the return type for the reflectee.
939 */ 932 */
940 TypeMirror get returnType; 933 TypeMirror get returnType;
941 934
942 /** 935 /**
936 * The source code for the reflectee, if available. Otherwise null.
937 */
938 String get source;
939
940 /**
943 * A list of mirrors on the parameters for the reflectee. 941 * A list of mirrors on the parameters for the reflectee.
944 */ 942 */
945 List<ParameterMirror> get parameters; 943 List<ParameterMirror> get parameters;
946 944
947 /** 945 /**
948 * Is the reflectee static? 946 * Is the reflectee static?
949 * 947 *
950 * For the purposes of the mirrors library, a top-level function is 948 * For the purposes of the mirrors library, a top-level function is
951 * considered static. 949 * considered static.
952 */ 950 */
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 * 1304 *
1307 * When used as metadata on an import of "dart:mirrors", this metadata does 1305 * When used as metadata on an import of "dart:mirrors", this metadata does
1308 * not apply to the library in which the annotation is used, but instead 1306 * not apply to the library in which the annotation is used, but instead
1309 * applies to the other libraries (all libraries if "*" is used). 1307 * applies to the other libraries (all libraries if "*" is used).
1310 */ 1308 */
1311 final override; 1309 final override;
1312 1310
1313 const MirrorsUsed( 1311 const MirrorsUsed(
1314 {this.symbols, this.targets, this.metaTargets, this.override}); 1312 {this.symbols, this.targets, this.metaTargets, this.override});
1315 } 1313 }
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/lib/lib.status » ('j') | tests/lib/lib.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698