| Index: sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart b/sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart
|
| index 003dda44768370e4daaa8994d6ab2ca587f32386..816c1883ac46fe5f9264c741df1608b77e2b3890 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart
|
| @@ -7,11 +7,15 @@ part of mirror_renamer;
|
| class MirrorRenamer {
|
| static const String MIRROR_HELPER_CLASS = 'MirrorHelper';
|
| static const String MIRROR_HELPER_GET_NAME_FUNCTION = 'getName';
|
| + static const String MIRROR_HELPER_ADD_RENAME_FUNCTION = 'addRename';
|
| +
|
| static const String MIRROR_HELPER_LIBRARY_NAME = 'mirror_helper.dart';
|
| static const String MIRROR_HELPER_LIBRARY_PREFIX = 'm';
|
| static const String MIRROR_HELPER_CLASS_FULLY_QUALIFIED_NAME =
|
| '$MIRROR_HELPER_LIBRARY_PREFIX.$MIRROR_HELPER_CLASS';
|
|
|
| + static Map<String, String> inverseRenames;
|
| +
|
| static void handleStaticSend(Map<Node, String> renames, Element element,
|
| Send node, Compiler compiler) {
|
| if (element == compiler.mirrorSystemGetNameFunction) {
|
| @@ -29,4 +33,17 @@ class MirrorRenamer {
|
| new Script(mirrorHelperUri, null));
|
| imports.putIfAbsent(mirrorHelperLib, () => MIRROR_HELPER_LIBRARY_PREFIX);
|
| }
|
| +
|
| + static void registerRenames(Map<Node, String> renames) {
|
| + inverseRenames = new Map<String, String>();
|
| +
|
| + for (Node node in renames.keys) {
|
| + if (node is Identifier) {
|
| + var stringValue = node.asIdentifier().source.stringValue;
|
| + if (stringValue != renames[node]) {
|
| + inverseRenames.putIfAbsent(renames[node], () => stringValue);
|
| + }
|
| + }
|
| + }
|
| + }
|
| }
|
|
|