Chromium Code Reviews| 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"); | 5 // #library("mirrors"); |
| 6 | 6 |
| 7 // The dart:mirrors library provides reflective access for Dart program. | 7 // The dart:mirrors library provides reflective access for Dart program. |
| 8 // | 8 // |
| 9 // For the purposes of the mirrors library, we adopt a naming | 9 // For the purposes of the mirrors library, we adopt a naming |
| 10 // convention with respect to getters and setters. Specifically, for | 10 // convention with respect to getters and setters. Specifically, for |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 * An immutable map from names to mirrors for all method, | 259 * An immutable map from names to mirrors for all method, |
| 260 * constructor, getter, and setter declarations in this library. | 260 * constructor, getter, and setter declarations in this library. |
| 261 */ | 261 */ |
| 262 Map<String, MethodMirror> methods(); | 262 Map<String, MethodMirror> methods(); |
| 263 | 263 |
| 264 /** | 264 /** |
| 265 * An immutable map from names to mirrors for all variable | 265 * An immutable map from names to mirrors for all variable |
| 266 * declarations in this library. | 266 * declarations in this library. |
| 267 */ | 267 */ |
| 268 Map<String, VariableMirror> variables(); | 268 Map<String, VariableMirror> variables(); |
| 269 | |
| 270 /** | |
| 271 * Invokes the named constructor and returns a mirror on the result. | |
| 272 * | |
| 273 * TODO(turnidge): Properly document. | |
| 274 */ | |
| 275 Future<InstanceMirror> newInstance(String constructorName, | |
|
rmacnak
2012/07/30 16:33:45
newInstance is somewhat misleading as a Dart const
Ivan Posva
2012/07/30 17:03:28
The same "confusion" can happen in non-mirrored Da
| |
| 276 List<Object> positionalArguments, | |
| 277 [Map<String,Object> namedArguments]); | |
| 269 } | 278 } |
| 270 | 279 |
| 271 /** | 280 /** |
| 272 * A [LibraryMirror] reflects a Dart language library, providing | 281 * A [LibraryMirror] reflects a Dart language library, providing |
| 273 * access to the variables, functions, classes, and interfaces of the | 282 * access to the variables, functions, classes, and interfaces of the |
| 274 * library. | 283 * library. |
| 275 */ | 284 */ |
| 276 interface LibraryMirror extends ObjectMirror { | 285 interface LibraryMirror extends ObjectMirror { |
| 277 /** | 286 /** |
| 278 * The name of this library, as provided in the [#library] declaration. | 287 * The name of this library, as provided in the [#library] declaration. |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 | 553 |
| 545 /** | 554 /** |
| 546 * A [MirrorException] is used to indicate errors within the mirrors | 555 * A [MirrorException] is used to indicate errors within the mirrors |
| 547 * framework. | 556 * framework. |
| 548 */ | 557 */ |
| 549 class MirrorException implements Exception { | 558 class MirrorException implements Exception { |
| 550 const MirrorException(String this._message); | 559 const MirrorException(String this._message); |
| 551 String toString() => "MirrorException: '$_message'"; | 560 String toString() => "MirrorException: '$_message'"; |
| 552 final String _message; | 561 final String _message; |
| 553 } | 562 } |
| OLD | NEW |