Chromium Code Reviews| 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 { |