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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_backend/emitter.dart

Issue 22791002: Add renames in output when using the mirror helper library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/dart_backend/emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/emitter.dart
index c58319ee6082fa9c8cb22d83bc9a72e3532371ff..c9e2940321bb17db1a4a08b8c6b4e5a648839cb6 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/emitter.dart
@@ -13,8 +13,16 @@ String emitCode(
unparser.unparseImportTag('${libraryElement.canonicalUri}', prefix);
});
+
ahe 2013/08/12 15:43:21 Extra line.
+ bool isTopLevelMain(Node node) =>
ahe 2013/08/12 15:43:21 In dart2js, we tend to perfer '{ return expr; }' w
ahe 2013/08/12 15:43:21 I'm not at all sure about this method. What is it
+ (node is FunctionExpression &&
ahe 2013/08/12 15:43:21 FunctionExpression functionExpression = node.asFun
+ (node as FunctionExpression).name.asIdentifier().source.
ahe 2013/08/12 15:43:21 ....source == const SourceString('main')
+ stringValue == 'main');
+
for (final node in topLevelNodes) {
- if (node is ClassNode) {
+ if ((unparser is MirrorRenamerUnparser) && isTopLevelMain(node)) {
+ (unparser as MirrorRenamerUnparser).unparseTopLevelMain(node);
ahe 2013/08/12 15:43:21 Don't use casts, they are slow and unnecessary. In
+ } else if (node is ClassNode) {
// TODO(smok): Filter out default constructors here.
unparser.unparseClassWithBody(node, classMembers[node]);
} else {

Powered by Google App Engine
This is Rietveld 408576698