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

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: Addressed comments and added tests. 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
13 static void handleStaticSend(Map<Node, String> renames, Element element,
14 Send node, Compiler compiler) {
15 if (element == compiler.mirrorSystemGetNameFunction) {
16 renames[node.selector] = MIRROR_HELPER_GET_NAME_FUNCTION;
17 renames[node.receiver] =
18 '$MIRROR_HELPER_LIBRARY_PREFIX.$MIRROR_HELPER_CLASS';
ahe 2013/08/06 15:53:36 This could be a constant as well.
zarah 2013/08/08 12:17:10 Done.
19 }
20 }
21
22 static void addMirrorHelperImport(Map<LibraryElement, String> imports) {
23 Uri mirrorHelperUri = new Uri(path: MIRROR_HELPER_LIBRARY_NAME);
24 //TODO(zarah) When actual mirror helper library is created
25 // change to load that.
26 LibraryElement mirrorHelperLib = new LibraryElementX(
27 new Script(mirrorHelperUri, null));
ahe 2013/08/06 15:53:36 I'm really not comfortable that you instantiate Li
zarah 2013/08/08 12:17:10 Done.
28 imports.putIfAbsent(mirrorHelperLib, () => MIRROR_HELPER_LIBRARY_PREFIX);
29 }
30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698