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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/mirror_renamer/renamer.dart

Issue 21339002: Rename MirrorSystem.getName calls in dart2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Format TODO comments. Created 7 years, 4 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
OLDNEW
(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 part of mirror_renamer;
6
7 class MirrorRenamer {
8 static const String MIRROR_HELPER_CLASS = 'MirrorHelper';
9 static const String MIRROR_HELPER_GET_NAME_FUNCTION = 'getName';
10 static const String MIRROR_HELPER_LIBRARY_NAME = 'mirror_helper.dart';
11 static const String MIRROR_HELPER_LIBRARY_PREFIX = 'm';
12 static const String MIRROR_HELPER_CLASS_FULLY_QUALIFIED_NAME =
13 '$MIRROR_HELPER_LIBRARY_PREFIX.$MIRROR_HELPER_CLASS';
14
15 static void handleStaticSend(Map<Node, String> renames, Element element,
16 Send node, Compiler compiler) {
17 if (element == compiler.mirrorSystemGetNameFunction) {
18 renames[node.selector] = MIRROR_HELPER_GET_NAME_FUNCTION;
19 renames[node.receiver] = MIRROR_HELPER_CLASS_FULLY_QUALIFIED_NAME;
20 }
21 }
22
23 static void addMirrorHelperImport(Map<LibraryElement, String> imports) {
24 Uri mirrorHelperUri = new Uri(path: MIRROR_HELPER_LIBRARY_NAME);
25 // TODO(zarah): Remove this hack! LibraryElementX should not be created
26 // outside the library loader. When actual mirror helper library
27 // is created, change to load that.
28 LibraryElement mirrorHelperLib = new LibraryElementX(
29 new Script(mirrorHelperUri, null));
30 imports.putIfAbsent(mirrorHelperLib, () => MIRROR_HELPER_LIBRARY_PREFIX);
31 }
32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698