| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 /** | |
| 5 * Helps dealing with reflection in the case that the source code has been | |
| 6 * changed as a result of compiling with dart2dart. | |
| 7 */ | |
| 8 library _mirror_helper; | |
| 9 | |
| 10 import 'dart:mirrors'; | |
| 11 | |
| 12 /// The compiler will replace this variable with a map containing all the | |
| 13 /// renames made in dart2dart. | |
| 14 const Map<String, String> _SYMBOLS = null; | |
| 15 | |
| 16 /// This method is a wrapper for MirrorSystem.getName() and will be inlined and | |
| 17 /// called in the generated output Dart code. | |
| 18 String helperGetName(Symbol sym) { | |
| 19 var name = MirrorSystem.getName(sym); | |
| 20 if (_SYMBOLS.containsKey(name)) { | |
| 21 return _SYMBOLS[name]; | |
| 22 } else { | |
| 23 return name; | |
| 24 } | |
| 25 } | |
| OLD | NEW |