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

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

Issue 23441073: Implement closurization of regular methods in ObjectMirror.getField in the VM. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 7 years, 2 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 | « runtime/vm/resolver.cc ('k') | tests/lib/lib.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) 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 * can be the implicit getter for a field or a user-defined getter 332 * can be the implicit getter for a field or a user-defined getter
333 * method. 333 * method.
334 * 334 *
335 * Let *o* be the object reflected by this mirror, let 335 * Let *o* be the object reflected by this mirror, let
336 * *f* be the simple name of the getter denoted by [fieldName], 336 * *f* be the simple name of the getter denoted by [fieldName],
337 * Then this method will perform the getter invocation 337 * Then this method will perform the getter invocation
338 * *o.f* 338 * *o.f*
339 * in a scope that has access to the private members 339 * in a scope that has access to the private members
340 * of *o* (if *o* is a class or library) or the private members of the 340 * of *o* (if *o* is a class or library) or the private members of the
341 * class of *o* (otherwise). 341 * class of *o* (otherwise).
342 *
343 * If this mirror is an [InstanceMirror], and [fieldName] denotes an instance
344 * method on its reflectee, the result of the invocation is an instance
345 * mirror on a closure corresponding to that method.
346 *
347 * If this mirror is a [LibraryMirror], and [fieldName] denotes a top-level
348 * method in the corresponding library, the result of the invocation is an
349 * instance mirror on a closure corresponding to that method.
350 *
351 * If this mirror is a [ClassMirror], and [fieldName] denotes a static method
352 * in the corresponding class, the result of the invocation is an instance
353 * mirror on a closure corresponding to that method.
354 *
342 * If the invocation returns a result *r*, this method returns 355 * If the invocation returns a result *r*, this method returns
343 * the result of calling [reflect](*r*). 356 * the result of calling [reflect](*r*).
344 * If the invocation causes a compilation error 357 * If the invocation causes a compilation error
345 * this method throws a [MirroredCompilationError]. 358 * this method throws a [MirroredCompilationError].
346 * If the invocation throws an exception *e* (that it does not catch) 359 * If the invocation throws an exception *e* (that it does not catch)
347 * this method throws *e*. 360 * this method throws *e*.
348 */ 361 */
349 /* TODO(turnidge): Handle ambiguous names.*/ 362 /* TODO(turnidge): Handle ambiguous names.*/
350 InstanceMirror getField(Symbol fieldName); 363 InstanceMirror getField(Symbol fieldName);
351 364
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 * can be the implicit getter for a field or a user-defined getter 427 * can be the implicit getter for a field or a user-defined getter
415 * method. 428 * method.
416 * 429 *
417 * Let *o* be the object reflected by this mirror, let 430 * Let *o* be the object reflected by this mirror, let
418 * *f* be the simple name of the getter denoted by [fieldName], 431 * *f* be the simple name of the getter denoted by [fieldName],
419 * Then this method will perform the getter invocation 432 * Then this method will perform the getter invocation
420 * *o.f* 433 * *o.f*
421 * in a scope that has access to the private members 434 * in a scope that has access to the private members
422 * of *o* (if *o* is a class or library) or the private members of the 435 * of *o* (if *o* is a class or library) or the private members of the
423 * class of *o*(otherwise). 436 * class of *o*(otherwise).
437 *
438 * If this mirror is an [InstanceMirror], and [fieldName] denotes an instance
439 * method on its reflectee, the result of the invocation is an instance
440 * mirror on a closure corresponding to that method.
441 *
442 * If this mirror is a [LibraryMirror], and [fieldName] denotes a top-level
443 * method in the corresponding library, the result of the invocation is an
444 * instance mirror on a closure corresponding to that method.
445 *
446 * If this mirror is a [ClassMirror], and [fieldName] denotes a static method
447 * in the corresponding class, the result of the invocation is an instance
448 * mirror on a closure corresponding to that method.
449 *
424 * The method returns a future *k*. 450 * The method returns a future *k*.
425 * If the invocation returns a result *r*, *k* will be completed 451 * If the invocation returns a result *r*, *k* will be completed
426 * with the result of calling [reflect](*r*). 452 * with the result of calling [reflect](*r*).
427 * If the invocation throws an exception *e* (that it does not catch) 453 * If the invocation throws an exception *e* (that it does not catch)
428 * then *k* is completed with a [MirrorError] wrapping *e*. 454 * then *k* is completed with a [MirrorError] wrapping *e*.
429 */ 455 */
430 /* TODO(turnidge): Handle ambiguous names.*/ 456 /* TODO(turnidge): Handle ambiguous names.*/
431 Future<InstanceMirror> getFieldAsync(Symbol fieldName); 457 Future<InstanceMirror> getFieldAsync(Symbol fieldName);
432 458
433 /** 459 /**
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 * 1347 *
1322 * When used as metadata on an import of "dart:mirrors", this metadata does 1348 * When used as metadata on an import of "dart:mirrors", this metadata does
1323 * not apply to the library in which the annotation is used, but instead 1349 * not apply to the library in which the annotation is used, but instead
1324 * applies to the other libraries (all libraries if "*" is used). 1350 * applies to the other libraries (all libraries if "*" is used).
1325 */ 1351 */
1326 final override; 1352 final override;
1327 1353
1328 const MirrorsUsed( 1354 const MirrorsUsed(
1329 {this.symbols, this.targets, this.metaTargets, this.override}); 1355 {this.symbols, this.targets, this.metaTargets, this.override});
1330 } 1356 }
OLDNEW
« no previous file with comments | « runtime/vm/resolver.cc ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698