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

Unified Diff: lib/src/js/printer.dart

Issue 1045323002: emit interfaces before use (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/constructors.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/js/printer.dart
diff --git a/lib/src/js/printer.dart b/lib/src/js/printer.dart
index e620087413b27a68ed9424921cc694d28123b5c8..1c1a1737ec744b732edf51f070ffc60ce7e67cd3 100644
--- a/lib/src/js/printer.dart
+++ b/lib/src/js/printer.dart
@@ -962,17 +962,21 @@ class Printer implements NodeVisitor {
visit(node.heritage);
}
spaceOut();
- out('{');
- lineOut();
- indentMore();
- for (var method in node.methods) {
- indent();
- visit(method);
+ if (node.methods.isNotEmpty) {
+ out('{');
lineOut();
+ indentMore();
+ for (var method in node.methods) {
+ indent();
+ visit(method);
+ lineOut();
+ }
+ indentLess();
+ indent();
+ out('}');
+ } else {
+ out('{}');
}
- indentLess();
- indent();
- out('}');
}
visitMethod(Method node) {
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/constructors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698