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 import "dart:nativewrappers"; | 5 import "dart:nativewrappers"; |
| 6 // TODO(ahe): Move _symbol_dev.Symbol to its own "private" library? |
| 7 import "dart:_collection-dev" as _symbol_dev; |
6 | 8 |
7 /** | 9 /** |
8 * Returns a [MirrorSystem] for the current isolate. | 10 * Returns a [MirrorSystem] for the current isolate. |
9 */ | 11 */ |
10 patch MirrorSystem currentMirrorSystem() { | 12 patch MirrorSystem currentMirrorSystem() { |
11 return _Mirrors.currentMirrorSystem(); | 13 return _Mirrors.currentMirrorSystem(); |
12 } | 14 } |
13 | 15 |
14 /** | 16 /** |
15 * Creates a [MirrorSystem] for the isolate which is listening on | 17 * Creates a [MirrorSystem] for the isolate which is listening on |
16 * the [SendPort]. | 18 * the [SendPort]. |
17 */ | 19 */ |
18 patch Future<MirrorSystem> mirrorSystemOf(SendPort port) { | 20 patch Future<MirrorSystem> mirrorSystemOf(SendPort port) { |
19 return _Mirrors.mirrorSystemOf(port); | 21 return _Mirrors.mirrorSystemOf(port); |
20 } | 22 } |
21 | 23 |
22 /** | 24 /** |
23 * Returns an [InstanceMirror] for some Dart language object. | 25 * Returns an [InstanceMirror] for some Dart language object. |
24 * | 26 * |
25 * This only works if this mirror system is associated with the | 27 * This only works if this mirror system is associated with the |
26 * current running isolate. | 28 * current running isolate. |
27 */ | 29 */ |
28 patch InstanceMirror reflect(Object reflectee) { | 30 patch InstanceMirror reflect(Object reflectee) { |
29 return _Mirrors.reflect(reflectee); | 31 return _Mirrors.reflect(reflectee); |
30 } | 32 } |
| 33 |
| 34 patch class MirrorSystem { |
| 35 /* patch */ static String getName(Symbol symbol) { |
| 36 return _symbol_dev.Symbol.getName(symbol); |
| 37 } |
| 38 } |
OLD | NEW |